‘No input file specified’ problem

If you’ve installed Expression Engine 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 Expression Engine 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 Expression Engine 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 ORIG_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:

  • del.icio.us
  • Digg
  • Ma.gnolia
  • Reddit
  • StumbleUpon
  • Design Float

Subscribe to this site for regular updates

6 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!

Pingbacks

  1. 1

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


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