0

我没有root优先级,所以我不能系统级别的PHP环境,所以我在我的主目录中构建了一个php安装,即/home/meow/build/

然后我将以下行添加到.htaccess:

AddHandler php-handler .php
Action php-handler "/home/meow/doaminname/cgi-bin"

那个cgi-bin其实是一个脚本,里面的内容是:

    exec "/home/meow/build/bin/php-cgi" $@

当我尝试访问域名/a.php 时,错误消息是:

The requested URL /home/meow/cgi-bin/p.php was not found on this server

怎么了?

4

1 回答 1

1

The Action directive wants a URL-path, not a file-path. That means your cgi-bin needs to be inside your site's document root, and the Action directive points to it via a path relative to the document root.

Without knowing how you have your document root setup, I'm going to guess you want something like:

Action php-handler "/cgi-bin"

That being you can access the same script via http://yourdomain.com/cgi-bin.

于 2013-09-07T11:29:05.300 回答