我将index.html 更改为index.php,但现在页面无法加载!
它给了我以下信息:
请求的URL /cgi-sys/php-cgiwrap/gcadmin/php5.cgi/projects/globalcolleage/index.php 在此服务器上找不到。
有什么建议吗?
(我正在使用 WAMP)
我认为它与此 hthaccess 文件有关:
IndexIgnore *
DirectoryIndex index.html index.HTML index.shtml index.cgi index.php index.php3 index.phtml index.htm home.html welcome.html
Action application/x-pair-sphp5 /cgi-sys/php-cgiwrap/gcadmin/php5.cgi
AddType application/x-pair-sphp5 .php
(the file exist: D:\wamp\www\projects\globalcolleage\index.php)
It gives me the following message:
The requested URL
/cgi-sys/php-cgiwrap/gcadmin/php5.cgi/projects/globalcolleage/index.php
was not found on this server.
Any suggestions?
(I'm using WAMP)
I think it has something to do with this hthaccess file:
IndexIgnore *
DirectoryIndex index.html index.HTML index.shtml index.cgi index.php index.php3 index.phtml index.htm home.html welcome.html
Action application/x-pair-sphp5 /cgi-sys/php-cgiwrap/gcadmin/php5.cgi
AddType application/x-pair-sphp5 .php
(the file exist: D:\wamp\www\projects\globalcolleage\index.php)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“在此服务器上找不到”通常表示您的网址有错误。 Apache 未找到请求的文件。检查您的网址是否有拼写错误并检查您的文件名。
接下来尝试一个不是索引的 php 文件,看看是否有效。如果普通文件工作但目录索引不工作,则检查您的 httpd.conf 中是否有如下行:
这告诉 apache 如果未找到 index.html,则使用 index.php 作为目录索引。
我敢打赌,网址中存在拼写错误,因为您收到了“找不到文件”错误。
编辑:
由于删除 .htaccess 文件解决了问题,我的猜测是 Action 指令设置不正确。
http://httpd.apache.org/docs/2.0/mod/mod_actions。 html
Action 指令设置一个程序来处理特定文件类型的请求。在开箱即用的设置中,php 不需要这样做。您可以通过这种方式将 php 用作 cgi 二进制文件,但它比使用 apache 模块更复杂。
"Not found on this server" normally indicates that you've got an error in your url. Apache isn't finding the requested file. Check your url for typos and check your filename.
Next try a php file which is not an index to see if that works. If normal files work but directory indexes don't, then check your httpd.conf for a line like this:
This tells apache to use index.php for directory index if index.html isn't found.
My bet is a typo in the url since you're getting a file not found error.
Edit:
Since removing the .htaccess file resolved the problem, my guess is that the Action directive was not set up correctly.
http://httpd.apache.org/docs/2.0/mod/mod_actions.html
The Action directive sets a program to handle requests for a particular file type. This is not needed with php in an out-of-the-box setup. You can use php as a cgi binary this way, but it's more complicated than using the apache module.
首先,您确定该文件存在吗?双重检查。
其次,打开
.htaccess
并输入此内容。这告诉 Apache 首先查找
index.html
,如果没有找到,则查找index.php.
Firstly, are you sure that file exists? Double check.
Secondly, open up
.htaccess
and type thisThis tells Apache to first look for
index.html
, and if not found, then look forindex.php
.