Codeigniter - no input file specified

koool picture koool · May 25, 2011 · Viewed 116.6k times · Source

I am a beginner in Codeigniter and I saw a CI tutorial and was just trying to do a simple thing. I downloaded the CI and added this file to controller directory, but it won't work.

<?php

class site extends CI_Controller
{
    public function index()
    {
        echo "Hello World";
    }

    function dosomething()
    {
        echo "Do Something";
    }   
}    
?>

When I try to access it using http://..../index.php/site I get the output ... "no input file specified" .... by the way, I named the file site.php

Answer

Ali Mohamed picture Ali Mohamed · Oct 25, 2012

Just add the ? sign after index.php in the .htaccess file :

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

and it would work !