php.net |  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
Votes:20
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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: me at paw-e-l dot net
New email:
PHP Version: OS:

 

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

apache 2 + mod_rewrite + mod_fcgid + php-cgi

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

http://somesite.net/test

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):
http://somesite.net/index.php/test

and php shows "no input file specified".
however when i try to access directly http://somesite.net/index.php/test everything works fine.

with my colleague we've fixed this issue by editing 2 lines in:
sapi/cgi/cgi_main.c

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

Test script:
---------------
<?
phpinfo();

Expected result:
----------------
see result of phpinfo() function

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

Patches

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

Pull Requests

History

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] yohgaki@php.net
Current master does not include your patch.
Do you still have this issue with 5.4 or up?
 [2015-03-29 23:01 UTC] kalle@php.net
-Status: Open +Status: No Feedback
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 13:01:29 2024 UTC