|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54636 "no input file specified" when using specific RewriteRule
Submitted: 2011-04-29 21:00 UTC Modified: 2015-03-29 23:01 UTC
Avg. Score:4.8 ± 0.4
Reproduced:18 of 18 (100.0%)
Same Version:10 (55.6%)
Same OS:13 (72.2%)
From: me at paw-e-l dot net Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.3SVN-2011-04-29 (SVN) OS: Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-04-29 21:00 UTC] me at paw-e-l dot net

apache 2 + mod_rewrite + mod_fcgid + php-cgi

blank page with "no input file specified" shows when trying to access url like this:

with .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

above sample address is rewrited to (i've checked mod_rewrite log to be sure):

and php shows "no input file specified".
however when i try to access directly everything works fine.

with my colleague we've fixed this issue by editing 2 lines in:

here is our working version (based on 306939 revision of cgi_main.c):
keep in mind that our "fix" was made just to get it work, so it may break something else ;)

Test script:

Expected result:
see result of phpinfo() function

Actual result:
blank page with "no input file specified"


path_for_cgi_main.c (last revision 2011-04-30 21:35 UTC by me at paw-e-l dot net)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-17 10:03 UTC] 777 dot mail dot on at gmail dot com
This problem I'm having when using CodeIgniter framework.
The problem is solved by means of a roundabout:

in .htaccess:
RewriteRule ^(.*)$ index.php?$1 [L]

in config.php of framework:
$config['uri_protocol']	= "REQUEST_URI";
 [2011-12-16 10:25 UTC] me at paw-e-l dot net
Yes, thats what people advise on framework forums.
I'am hoping for some official fix in cgi_main.c
 [2014-07-16 02:38 UTC]
Current master does not include your patch.
Do you still have this issue with 5.4 or up?
 [2015-03-29 23:01 UTC]
-Status: Open +Status: No Feedback
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 15:01:28 2024 UTC