我将index.html 更改为index.php,但现在页面无法加载!

发布于 2024-08-30 10:53:04 字数 572 浏览 1 评论 0原文

它给了我以下信息:

请求的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

李不 2024-09-06 10:53:04

“在此服务器上找不到”通常表示您的网址有错误。 Apache 未找到请求的文件。检查您的网址是否有拼写错误并检查您的文件名。

接下来尝试一个不是索引的 php 文件,看看是否有效。如果普通文件工作但目录索引不工作,则检查您的 httpd.conf 中是否有如下行:

DirectoryIndex index.html index.php

这告诉 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:

DirectoryIndex index.html index.php

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.

森林散布 2024-09-06 10:53:04

首先,您确定该文件存在吗?双重检查。

其次,打开 .htaccess 并输入此内容。

DirectoryIndex index.html index.php

这告诉 Apache 首先查找 index.html,如果没有找到,则查找 index.php.

Firstly, are you sure that file exists? Double check.

Secondly, open up .htaccess and type this

DirectoryIndex index.html index.php

This tells Apache to first look for index.html, and if not found, then look for index.php.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文