‘No input file specified’ problem

If you’ve installed ExpressionEngine but find you get a ‘No input file specified’ error message on anything but the home page of the site, chances are it’s because your server doesn’t support the path_info server variable.

This happened to me recently when my web host migrated my accounts to a new server and in the process made some configuration changes, one of which involved disabling path_info.

According to the ExpressionEngine Knowledge Base, there are a couple of options available to you if this is the case with your server:

  • You can turn on the ‘Force Query String’ setting in the ExpressionEngine control panel, found at Admin | System Preferences | Output and Debugging Preferences. This of course means that all your URLs will have a query string in them and look something like www.example.com/?/filename/.

  • Or you can edit your index.php and replace:

    $path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');

    with

    $path_info = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO');

So essentially, just replacing PATH_INFO with ORIG_PATH_INFO.

In my case, however, this wasn’t quite enough and as I didn’t find any mention of this important little fact anywhere, I thought it was worth mentioning here. The reason the workarounds weren’t working was because I was also using a .htaccess file to remove index.php from the URL:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

What was missing was the ? from the rewrite rule, so the last line should look like:

RewriteRule ^(.*)$ /index.php?/$1 [L]

As one of the technical support guys at my host said, “It’s always the little things that cause the most trouble.” ;)

Browse by tags:

Tags: , ,

Share this article:
  • Twitter
  • FriendFeed
  • del.icio.us
  • Digg
  • StumbleUpon
  • Facebook
  • Reddit
  • Sphinn

Subscribe to this site for regular updates

12 responses to ‘No input file specified’ problem. Add your own.

Comments

  1. 1

    Great tip! Fixed my issue! Thanks you very much. Oh mod_rewrite how I hate thee…. :)

  2. 2

    Adding that little question mark fixed my file as well! However, I know thecity.org has removed index.php, but they don’t have a ? in their .htaccess file. So, whatever, hopefully there will be no negative effects.

  3. 3

    Whether you need the ? will depend on your web host. For sites I’d done I didn’t originally need it either, but then my host made some configuration changes after which I did need to do it.

  4. 4

    Worked! ;) thanx a lot mate

  5. 5

    Thank you!!! Saved me a ton of time!

  6. 6

    Thank you so much for this post. Solved my problem easily. I couldn’t figure out what was going on as I had all my settings correct according to the host.

    PS - small typo:

    So essentially, just replacing ORIG_PATH_INFO with ORIG_PATH_INFO.

    should read

    So essentially, just replacing PATH_INFO with ORIG_PATH_INFO.

  7. 7

    Hi Philip, thanks for pointing that out. :)

  8. 8

    For anyone who might be using CodeIgniter with mod_rewrite on Fasthosts web hosting in the UK, the question mark tip fixes the problem!

    You’ve saved me hours John, thank you!

  9. 9

    No problem. :)

  10. 10

    Thanks for this, much appreciated!

  11. 11

    Thanks a lot
    solved my problem

Pingbacks

  1. 1

    […] ‘No input file specified’ problem — Tyssen Design (tags: php apache htaccess) […]

Feed for this post's comments


Required indicates required field.
Email will not be published

You can use these tags in your reply:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Leave a Reply

Contact details

Spam Protection by WP-SpamFree