我需要在Windows XP上用PHPbuild立一个简单的Web服务器,许多不同的人将用于本地testing。
我正在使用LightTPD 1.4.30-4-IPv6-Win32-SSL和PHP 5.2。
到目前为止,我创build了这个文件夹结构:
tools/ LightTPD/ htdocs/ PHP/
我将PHP设置为CGI,将文档根设置为server_root + "/htdocs" 。 它工作正常(嗯,这很慢,但我现在不想打扰FastCGI :))。
我的问题是当我尝试把LightTPD文件夹之外的htdocs,如下所示:
htdocs/ tools/ LightTPD/ PHP/
我将文档根目录更新为server_root + "/../../htdocs" ,而静态HTML页面正常工作 ,PHP页面停止工作(它们返回“没有指定input文件”)。 我从字面上只是改变文档根,我没有改变php.ini或任何其他地方的任何东西。 还请注意,我将所有的doc_root , user_dir和cgi.force_redirect都保留在php.ini中的缺省值,并且当htdocs在LightTPD中时,它可以工作,但是当我将它移动到另一个时,它就不起作用。
任何想法,为什么它打破了?
这是我的lightTPD.conf:
server.modules = ( "mod_access", "mod_accesslog", "mod_alias", "mod_cgi", "mod_status", ) include "variables.conf" include "mimetype.conf" # THIS WORKS server.document-root = server_root + "/htdocs" # THIS DOESN'T #server.document-root = server_root + "/../../htdocs" server.upload-dirs = ( temp_dir ) index-file.names = ( "index.php", "index.pl", "index.cgi", "index.cml", "index.html", "index.htm", "default.htm" ) server.event-handler = "libev" url.access-deny = ( "~", ".inc" ) $HTTP["url"] =~ "\.pdf$" { server.range-requests = "disable" } static-file.exclude-extensions = ( ".php", ".pl", ".cgi" ) server.errorlog = server_root + "/logs/error.log" ######### Options that are good to be but not neccesary to be changed ####### dir-listing.activate = "enable" #### CGI module cgi.assign = ( ".php" => server_root + "/../PHP/php-cgi.exe" ) status.status-url = "/server-status" status.config-url = "/server-config"
我不能给你为什么,但轻盈似乎不喜欢父母..符号。 我只是testing了这一点,如果你指定完整的path(不要打扰在你的configuration中使用server_root ,它将工作。