From:             nospam at bigalex dot it
Operating system: Irrelevant
PHP version:      5.4Git-2012-06-09 (Git)
Package:          FPM related
Bug Type:         Bug
Bug description:PHP-FPM chroot never-solved problems (extends #55322)

Description:
------------
Since PHP-FPM is the one taking care of the chroot, I think the problems
related 
to inconsistent variables should be solved here.

In fact, even if the environment is chrooted, the following variables still
give 
the unchrooted content:

$_SERVER["SCRIPT_FILENAME"]
$_SERVER["PATH_TRANSLATED"]
$_SERVER["DOCUMENT_ROOT"]

I don't think this behaviour has to be solved by apache, nginx, lighttpd or
any 
other web server, since the web server is not chrooted, instead it is
connecting 
to PHP-FPM process through (tcp) sockets; for this reason I am working on a

patch to fix this behaviour and in case the bug will be accepted, 
I will be happy to share the solution with you ;-)

I've already looked for a solution or a bug request about it, and the bug
#55322 
is already about this problem; my analysis however is deeper than the other

because the variables seems to be three and not just one.
The proposed "fix" to symlink the real path into the chroot isn't clean, so
I 
think this should be resolved here, inside php-fpm, and not with some weird

workarounds.

Test script:
---------------
Inside a pool, I use the chroot feature, this way:

chroot = /home/vhosts/h0001

expecting the scripts would be allowed to be executed with the chroot
environment in mind, so the variables SCRIPT_FILENAME, PATH_TRANSLATED,
DOCUMENT_ROOT should be changed accordingly before the script being
executed (so their value should be the one into the chroot environment).

Expected result:
----------------
As an example, the value $_SERVER["PATH_TRANSLATED"] should be 
/home/domains/test.com/phpinfo.php

Actual result:
--------------
As an example, the value $_SERVER["PATH_TRANSLATED"] is 
/home/vhosts/h0001/home/domains/test.com/phpinfo.php

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

Reply via email to