新手小问:CI访问错误
在看文档的时候,照他的例子在application/controllers/下面新建了一个blog.php的文件,而且也键入了代码,但是用http://localhost/CodeIgniter/index.php/blog访问的时候,却出现:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contactthe webmaster.Error 404localhost
2009年12月15日 星期二 21时14分58秒
Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
这个是什么原因呢?(P.S.路径中的CodeIgniter是个文件夹,就是官网载的那个东西)
是不是访问方式错误了? 恩,照别人的提示,自己搜索到了一个帖子,结果发现路径错误了,然后改成:
http://example.com/CodeIgniter/index.php
这样子访问以后去出现以下提示,没有成功……
Not Found
The requested URL /CodeIgniter/index.php was not found on this server.
Apache/2.2.3 (CentOS) Server at example.com Port 80 楼主的 APACHE 不支持 PATH_INFO 吧?这个需要看配置的,是服务器环境问题。
可以贴 php_info() 结果看一下。 回复 3# Hex
现在找到原因了,本来装的xampp下面htdocs在很深的地方,结果我想改到E:/www ,然后按照网上的提示修改httpd.conf(好像是这个文件,忘记了),然后找到两个地方是htdocs的路径,全部改成E:/www,结果修改完成以后,xampp读取的还是htdocs的东西,而不是www里面的东西,所以我放在www里面的CI自然不能访问到了~
现在我把CI放在htdocs 可以正常访问了,想随便问一下,怎么改这个路径呢? 其实保留 XAMPP 默认的ROOT目录有好处的,楼主最好是配置apache的虚拟目录
在\xampp\apache\conf\extra\httpd-vhosts.conf 里配置
必须记住第一个虚拟主机一定要指向 你的主目录 也就是 htdocs 目录
我给看一下我的配置内容,便于你参考
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot D:/web/xampp/htdocs/
<Directory "D:/web/xampp/htdocs/">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
#这里的是你要配置的虚拟主机
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName wp.com #这里是你的虚拟主机的名称,也是可访问的域名
DocumentRoot D:/web/wordpress/rootwww/#这里是你的网站的物理路径
<Directory "D:/web/wordpress/rootwww/"> #这里是虚拟主机的一些权限的设置
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
# 这里是日志记录,可以不写,直接删掉得了
ErrorLog D:/web/wordpress/log/error.log
LogLevel warn
CustomLog D:/web/wordpress/log/access.log combined
</VirtualHost>
页:
[1]