Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I would like to use Lighttpd and PHP to provide a lightweight standalone web server on Windows. I downloaded all the latest builds yesterday and after an hour everything was working fine.

Today, I changed server.document-root from server_root + "/htdocs" to server_root + "/../htdocs" and adjusted my directory structure accordingly. After restarting everything, I see "No input file specified" in the web browser when I try to access php pages.

Here are my configuration files. Of course, I've tried playing with cgi.fix_pathinfo and fastcgi.server but I can't seem to find the correct settings. Any ideas?

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" )

this directory structure works

c:\base_dir
    \php
    \lightTPD
       \htdocs

this is the directory structure I'm trying to achieve

c:\base_dir
     \htdocs
     \php
     \lightTPD
share|improve this question
    
Have you check this part of the doc? –  j0k Aug 31 '12 at 19:39
    
Yes. That's why I was playing with cgi.fix_pathinfo and fastcgi.server. Thanks for the tip though. –  Larry Aug 31 '12 at 19:52
1  
Have you tried to put the absolute path to htdocs instead of the relative one (with /../ inside)? –  j0k Aug 31 '12 at 21:34
1  
Thanks for the advice but I don't want to use absolute paths. I'm using a workaround for now. –  Larry Sep 2 '12 at 17:05

1 Answer 1

I'm using a workaround for now.

mklink /J htdocs ..\htdocs

If anyone has a better solution I'd be happy to hear it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.