<p>I’ve been struggling with a “No input file specified” issue, and I’ve
been trying to figure out the routing issue. I am using fast-cgi, nginx
(version 0.7.65) and CI 2.02</p>
<div class="codeblock"><code><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(255, 128, 0);"># <a href="http://www.example.net/ci/">http://www.example.net/ci/</a> /* Works */<br># <a href="http://www.example.net/ci/index.php">http://www.example.net/ci/index.php</a> /* Works */<br>
# <a href="http://www.example.net/ci/index.php/welcome">http://www.example.net/ci/index.php/welcome</a> /* Put out "No input file specified." - a 404 in access.log */ </span>
</span>
</code></div>
<p>The reason I see the problem is because I see this in the CI logs for *all* http requests
</p><div class="codeblock"><code><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 187);">DEBUG </span><span style="color: rgb(0, 119, 0);">- </span><span style="color: rgb(0, 0, 187);">2011</span><span style="color: rgb(0, 119, 0);">-</span><span style="color: rgb(0, 0, 187);">06</span><span style="color: rgb(0, 119, 0);">-</span><span style="color: rgb(0, 0, 187);">05 19</span><span style="color: rgb(0, 119, 0);">:</span><span style="color: rgb(0, 0, 187);">47</span><span style="color: rgb(0, 119, 0);">:</span><span style="color: rgb(0, 0, 187);">23 </span><span style="color: rgb(0, 119, 0);">--> </span><span style="color: rgb(0, 0, 187);">No URI present</span><span style="color: rgb(0, 119, 0);">. Default </span><span style="color: rgb(0, 0, 187);">controller set</span><span style="color: rgb(0, 119, 0);">. </span>
</span>
</code></div>
<p>I did not want to litter my first post with code, so here is the pertinent info presented neatly:</p>
<p>I changed AUTO to others, and no change in behavior.
</p><div class="codeblock"><code><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(255, 128, 0);"># /home/examples/<a href="http://example.net/public_html/ci/application/config/config.php">example.net/public_html/ci/application/config/config.php</a> <br>#standard configs except for the following:<br>
</span><span style="color: rgb(0, 0, 187);">$config[</span><span style="color: rgb(221, 0, 0);">'base_url'</span><span style="color: rgb(0, 0, 187);">] </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">'<a href="http://www.example.net/ci/">http://www.example.net/ci/</a>'</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">$config[</span><span style="color: rgb(221, 0, 0);">'index_page'</span><span style="color: rgb(0, 0, 187);">] </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">'index.php'</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">$config[</span><span style="color: rgb(221, 0, 0);">'uri_protocol'</span><span style="color: rgb(0, 0, 187);">] </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">'AUTO'</span><span style="color: rgb(0, 119, 0);">; </span>
</span>
</code></div>
<p>I tried adding a new loc for /ci and that did not work (i.e got the
“No input file specified” error) so I took that off to get back to
basics.</p>
<div class="codeblock"><code><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(255, 128, 0);"># /etc/nginx/sites-enabled/<a href="http://www.example.net">www.example.net</a><br><br><br></span><span style="color: rgb(0, 0, 187);">server {<br> server_name example</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">net</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">rewrite </span><span style="color: rgb(0, 119, 0);">^(.*) </span><span style="color: rgb(0, 0, 187);">http</span><span style="color: rgb(0, 119, 0);">:</span><span style="color: rgb(255, 128, 0);">//<a href="http://www.example.net">www.example.net</a>$1 permanent;<br>
</span><span style="color: rgb(0, 0, 187);">}<br>server {<br> listen 80</span><span style="color: rgb(0, 119, 0);">;<br> </span><span style="color: rgb(0, 0, 187);">server_name www</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">example</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">net</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">access_log </span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">srv</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">www</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">www</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">example</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">net</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">logs</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">access</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">log</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">error_log </span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">srv</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">www</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">www</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">example</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">net</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">logs</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">error</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">log debug</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">client_max_body_size 3M</span><span style="color: rgb(0, 119, 0);">;<br> </span><span style="color: rgb(0, 0, 187);">location </span><span style="color: rgb(0, 119, 0);">/ </span><span style="color: rgb(0, 0, 187);">{<br>
root </span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">srv</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">www</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">www</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">example</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">net</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">public_html</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">index index</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">html index</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">htm index</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">php</span><span style="color: rgb(0, 119, 0);">;<br>
if (!-</span><span style="color: rgb(0, 0, 187);">e $request_filename</span><span style="color: rgb(0, 119, 0);">) </span><span style="color: rgb(0, 0, 187);">{<br> rewrite </span><span style="color: rgb(0, 119, 0);">^.*$ /</span><span style="color: rgb(0, 0, 187);">index</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">php last</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">}<br> }<br> location </span><span style="color: rgb(0, 119, 0);">~ </span><span style="color: rgb(0, 0, 187);">\</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">php</span><span style="color: rgb(0, 119, 0);">$ </span><span style="color: rgb(0, 0, 187);">{<br>
</span><span style="color: rgb(0, 119, 0);">include /</span><span style="color: rgb(0, 0, 187);">etc</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">nginx</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">fastcgi_params</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">fastcgi_pass 127.0.0.1</span><span style="color: rgb(0, 119, 0);">:</span><span style="color: rgb(0, 0, 187);">9000</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">fastcgi_index index</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">php</span><span style="color: rgb(0, 119, 0);">;<br> </span><span style="color: rgb(0, 0, 187);">fastcgi_param SCRIPT_FILENAME </span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">srv</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">www</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">www</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">example</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">net</span><span style="color: rgb(0, 119, 0);">/</span><span style="color: rgb(0, 0, 187);">public_html$fastcgi_script_name</span><span style="color: rgb(0, 119, 0);">;<br>
</span><span style="color: rgb(0, 0, 187);">}<br>} </span>
</span>
</code></div>
<p>I went through the .httaccess route to remove the index.php, but did
not want to try too many things at once. I would like to get the bare
bones working and then add other layers.</p>
<p>Interestingly, $_SERVER[‘REQUEST_URI’] puts the correct URI, but $this->uri->uri_string() is blank.</p>
<p>I’d be grateful for any advice and thanks in advance. <br></p><p><br></p><p>PS - this is cross posted from <a href="http://codeigniter.com/forums/viewthread/190827/">another forum</a>, and I hope it does not offend anyone :)<br>
</p>