From:             
Operating system: Linux
PHP version:      5.3.2
Package:          CGI related
Bug Type:         Bug
Bug description:script path not correctly evaluated

Description:
------------
Using PHP as CGI (not FastCGI).



Pertinent php.ini values:

include_path="/home/httpd/cgi-bin/rcttrunk1.cfg/scripts:."

doc_root="/home/httpd/cgi-bin/rcttrunk1.cfg/scripts"



Path to file:

/home/httpd/cgi-bin/rcttrunk1.cfg/scripts/admin/launch.php



When I hit the following URL, I get a "file not found" error:

http://<server_name>/cgi-bin/rcttrunk1.cfg/php/admin/launch.php





Please see my patch below to fix the issue. The problem is that length is
evaluating to 1, rather than string length, because of operator precedence.
The solution is to wrap (length = strlen(...)) in its own set of
parentheses.

Test script:
---------------
Happens for any script.

Expected result:
----------------
The page loads.

Actual result:
--------------
"File not found." Error

-- 
Edit bug report at http://bugs.php.net/bug.php?id=51627&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51627&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51627&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51627&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51627&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51627&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51627&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51627&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51627&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51627&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51627&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51627&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51627&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51627&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51627&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51627&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51627&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51627&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51627&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51627&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51627&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51627&r=mysqlcfg

Reply via email to