我想使用Lighttpd和PHP在Windows上提供轻量级的独立Web服务器。 我昨天下载了所有最新版本,一小时后,一切正常。
今天,我将server.document-root从server_root +“/ htdocs”更改为server_root +“/../ htdocs” ,并相应地调整了我的目录结构。 重新启动一切后,当我尝试访问php页面时,在Web浏览器中看到“没有指定input文件”。
这是我的configuration文件。 当然,我试着玩cgi.fix_pathinfo和fastcgi.server,但我似乎无法find正确的设置。 有任何想法吗?
php.ini中
cgi.fix_pathinfo=1 extension_dir = .\ext extension = php_pdo_sqlite.dll date.timezone = UTC log_errors = On error_log = ..\logs\php_error.log
lighttpd.conf
## modules to load # at least mod_access and mod_accesslog should be loaded server.modules = ( "mod_access", "mod_accesslog", "mod_fastcgi", # "mod_cgi", "mod_status" ) #### include important configuration files include "variables.conf" include "mimetype.conf" ## a static document-root ## works fine server.document-root = server_root + "/htdocs" ## causes "No input file specified" #server.document-root = server_root + "/../htdocs" # extensions that should not be handle via static-file transfer static-file.exclude-extensions = ( ".php" ) ## virtual directory listings dir-listing.activate = "disable" #directory for file uploads server.upload-dirs = ( temp_dir ) # files to check for if .../ is requested index-file.names = ( "index.php", "index.html" ) ## set the event-handler (read the performance section in the manual) server.event-handler = "libev" ## deny access the file-extensions url.access-deny = ( "~", ".inc", ".htaccess" ) ## disable range request for PDF files $HTTP["url"] =~ "\.pdf$" { server.range-requests = "disable" } #### status module status.status-url = "/server-status" status.config-url = "/server-config" #### fastcgi module fastcgi.server = ( ".php" => ("localhost" => ("host" => "127.0.0.1", "port" => 521, "broken-scriptfilename" => "enable" ))) #cgi.assign = ( ".php" => "C:/development/tds/PHP/php-cgi.exe" )
这个目录结构起作用
c:\base_dir \php \lightTPD \htdocs
这是我试图实现的目录结构
c:\base_dir \htdocs \php \lightTPD
我现在正在使用一种解决方法。
mklink /J htdocs ..\htdocs
如果有人有更好的解决scheme,我会很高兴听到。
检查你的doc_root在php.ini中设置正确
doc_root = C:\base_dir\htdocs
这是我所需要的
如果你不想要一个绝对path,你可以取消它,它也应该工作。
; doc_root = ""
只是尝试了我的没有问题