Error at Codeigniter “No Input File Specified”

Sometimes life become hell for some unexpected errors. Well, this is not unexpected error, it can be   occurred if you run your application at PHP5 as CGI mode on Apache 2.2.  You may face it if you run your application at shared hosting.

Last week, I ran into this problem when I used Codeigniter for rapid development in one of my client’s applications. The web application worked very well in development environment but it generated the error “No Input File Specified” when I uploaded it shared hosting. By default, the hosting company set cgi.fix_pathinfo to 1.   So, Apache doesn’t support “PATH_INFO” inside Codeigniter. There are two ways to solve it. Before solving the problem, make sure that you have following configurations  at /application/config/config.php in Codeignitet.

$config['index_page'] = “”;
$config['uri_protocol'] = “AUTO“;

Now, either you can customize php.ini at root directory or change the .htaccess.

Make your .htaccess like follwoing..

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

OR customize the php.ini by adding the following line:

cgi.fix_pathinfo = 0;

Happy Hacking 🙂

Leave a Reply to eftakhairul Cancel reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Pingback: CodeIgniterでNo input file specifiedの対処法 | プログラミングノート

  2. I am really thankful for this post. I struggled for a long time with codeIgniter and godaddy. This helped me out

  3. Solved my problem in a single google search. Proves you have helped a lot of them to solve this issue.


  4. I have tried the above and a Billion other things… But between all that & deleteing the HTACCESS file… you cant see a smdge of difference ;(

  5. Thanks Lot….So much help full to me……A big problem has been resolved in just few seconds……Again Thanks.. 🙂