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 🙂
This helped me out when I installed Gallery CMS onto my Go Daddy hosting. Many thanks for the help,
Andy
The only problem I noticed with using this .htaccess approach is that CI’s ‘default controller’ setting (in routes.php) no longer seems to be taking effect, so that I always have to specify the controller name.
Yeah, you will have to do that. .
You welcome 🙂
Had the same problem. Your htaccess hack saved me a lot of trouble. Thanks!
thanks for your comment.
Thanks for your comment. Keep in touch for more tech posts.
I am really thankful for this post. I struggled for a long time with codeIgniter and godaddy. This helped me out
Thanks Zhang,
keep in touch in my blog for more interesting posts.
Solved my problem in a single google search. Proves you have helped a lot of them to solve this issue.
thanks
thanks for your commnet.
That is good information, it is useful to me thanks.
Thanks …
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 ;(
Most useful post.
Perfect answer.
Thanks 🙂
Thanks for your feedback. Keep in touch for more posts.
I’ve tried many others but yours is perfect for me. Thanks a huge.
Thanks for comment.
Thanks Lot….So much help full to me……A big problem has been resolved in just few seconds……Again Thanks.. 🙂
You welcome 🙂
Thanks a lot 🙂 . it also worked for me 🙂
You welcome 🙂
HalleleuYA!!
Thanks…solved….
Thanks for comment.
Thanks. From last 3 days i tried lots of things. But now finally it resolved by your help.
Thanks a lot.
Manoj
Thanks a lot! This is just the solution I was looking for.
Problem not solved even after changing the .htaccess file as specified above.
Every time if i add a ? after my index.php as below then only it is working. Any other solution please send us. Thanks in advance
http://artguroo.com/test/CItest/index.php?/mytesting
My default controller http://artguroo.com/test/CItest/
I will check and let you know.
Thank you, very helpfull 🙂
Thanks and keep reading my blog.
Thanks For The Help….
Very helpful when I testing a Beta Version for my site
Thanks Alot Your are good, helped me alot