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

I'm getting the following error...

No input file specified. 

...in response to the following URL:

The target file certainly exists and is working:

This seems to be a problem with the mod_rewrite package. Here is the apache configuration file:

FastCgiServer /home/www/mygarble.com/1.8.0/public_http/php-fastcgi

    ServerName www.mygarble.com
    ServerAdmin someone@somewhere.else
    ErrorLog /var/log/apache2/error.log
    CustomLog /var/log/apache2/access.log combined
    ServerSignature Off
    LogLevel warn

    DocumentRoot /home/www/mygarble.com/1.8.0/public_http/
    <Directory /home/www/mygarble.com/1.8.0/public_http/>
        Order allow,deny
        allow from all
    <Directory /home/www/mygarble.com/1.8.0/public_http/php>
        AddHandler php-fastcgi .php
        Action php-fastcgi /php-fastcgi

    RewriteEngine on

    RewriteLog /var/log/apache2/rewrite.log
    RewriteLogLevel 9

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule /hello$ /home/www/mygarble.com/1.8.0/public_http/php/helloworld.php [L]


This configuration worked absolutely fine on the previous version of Ubuntu. I've just upgraded from Lucid to Natty, and now this problem has surfaced.

Thanks for any help!

Update: The rewrite log is returning the following:

initial] (2) init rewrite engine with requested uri /hello
initial] (3) applying pattern '/hello$' to uri '/hello'
initial] (4) RewriteCond: input='' pattern='^$' => matched
initial] (2) rewrite '/hello' -> '/home/www/mygarble.com/1.8.0/public_http/php/helloworld.php'
initial] (2) local path result: /home/www/mygarble.com/1.8.0/public_http/php/helloworld.php
initial] (1) go-ahead with /home/www/mygarble.com/1.8.0/public_http/php/helloworld.php [OK]
initial/redir#1] (2) init rewrite engine with requested uri /php-fastcgi/hello
initial/redir#1] (3) applying pattern '/hello$' to uri '/php-fastcgi/hello'
initial/redir#1] (4) RewriteCond: input='200' pattern='^$' => not-matched
initial/redir#1] (1) pass through /php-fastcgi/hello
subreq] (2) init rewrite engine with requested uri /hello
subreq] (3) applying pattern '/hello$' to uri '/hello'
subreq] (4) RewriteCond: input='200' pattern='^$' => not-matched
subreq] (1) pass through /hello

The first match seems to work, but then /php-fastcgi/hello is being matched. Is this where the problem lies?

share|improve this question
It may just be me, but is the RewriteRule missing the leading regex anchor? ^ –  Tim Jan 17 '12 at 15:37
I've checked that out. For some reason there was a very good reason why I left them all out (the config file you see here is much abrigded). The problem is definitely to do with the display of a php script as a result of a rewrite. Displaying a text file as the result of a rewrite or displaying the php file directly works fine. I'm beginning to think that this is a bug. –  James Smith Jan 17 '12 at 17:15
I've updated the config file...RewriteEngine on RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule /hello$ /php/helloworld.php [L] you can now see this yourself with –  James Smith Jan 17 '12 at 17:20
Another update: both the access log and http header give 404 Not Found. –  James Smith Jan 17 '12 at 17:50
You have no RewriteBase directive, and your Rewrite rules are defined outside of the Directory directives. I believe apache and PHP cannot come up with the fully qualified path. Try RewriteBase /home/www/mygarble.com/1.8.0/public_http/, or change the Rewrite rule to cover the full path –  Tim Jan 17 '12 at 17:54

Your Answer


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

Browse other questions tagged or ask your own question.