Bug #51860 [Fbk]: Include fails with toplevel symlink to /
Edit report at https://bugs.php.net/bug.php?id=51860edit=1 ID: 51860 Updated by: ras...@php.net Reported by:stephan dot suerken at 1und1 dot de Summary:Include fails with toplevel symlink to / Status: Feedback Type: Bug Package:Scripting Engine problem PHP Version:5.3.2 Block user comment: N Private report: N New Comment: Never mind, I see it now. % php phptest/phpinc OK But % php /phptest/phpinc Warning: include(/phptest/phpfile): failed to open stream: No such file or directory in /phpinc on line 2 Warning: include(): Failed opening '/phptest/phpfile' for inclusion (include_path='.:/usr/local/lib/php') in /phpinc on line 2 Previous Comments: [2012-01-28 18:44:05] ras...@php.net I am unable to reproduce this with current PHP versions. Here is what I did: % cd / % ln -s / phptest % echo OK /phpfile % echo '?php include /phptest/phpfile;' /phpinc % /home/rasmus/php-src/branches/PHP_5_4/sapi/cli/php phpinc OK % /home/rasmus/php-src/branches/PHP_5_3/sapi/cli/php phpinc OK % php phpinc OK % cd /phptest % php phpinc OK What am I missing? This seems to be exactly the setup that thekid described. [2012-01-28 13:39:24] grobmeier at gmail dot com I can only agree with startup09. Please fix it. Thousands 11 (among others) customers are using old PHP because of this one. It is going to have birthday soon. I cannot upgrade my Open Source projects because 5.2 ist sill used on so many hosts. You need to get this done if you really have an interest your users migrate to 5.3. [2012-01-17 14:51:40] startup09 at web dot de please fix this! 11 still uses 5.2 for all customers because of this bug. I'm one of these poor people and can't use newer extensions which require 5.3 :( [2011-07-06 10:36:49] rainer at hosting-ist-mein-leben dot de In latest 5.4.0-alpha1 problem is still there. [2011-01-21 10:34:00] plubber at gmx dot ch no solution? I have the same problem with mounted NFS The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=51860 -- Edit this bug report at https://bugs.php.net/bug.php?id=51860edit=1
Bug #51860 [Fbk]: Include fails with toplevel symlink to /
Edit report at https://bugs.php.net/bug.php?id=51860edit=1 ID: 51860 Updated by: ras...@php.net Reported by:stephan dot suerken at 1und1 dot de Summary:Include fails with toplevel symlink to / Status: Feedback Type: Bug Package:Scripting Engine problem PHP Version:5.3.2 Block user comment: N Private report: N New Comment: It turns out that this is a bug in the realpath cache implementation we added in 5.3. An inefficient workaround is to set realpath_cache_size=0 in your php.ini, That fixes the issue, but you take a performance hit in terms of extra lstat calls. Still working on a simple fix that doesn't break everything for this one. Previous Comments: [2012-01-28 18:48:31] ras...@php.net Never mind, I see it now. % php phptest/phpinc OK But % php /phptest/phpinc Warning: include(/phptest/phpfile): failed to open stream: No such file or directory in /phpinc on line 2 Warning: include(): Failed opening '/phptest/phpfile' for inclusion (include_path='.:/usr/local/lib/php') in /phpinc on line 2 [2012-01-28 18:44:05] ras...@php.net I am unable to reproduce this with current PHP versions. Here is what I did: % cd / % ln -s / phptest % echo OK /phpfile % echo '?php include /phptest/phpfile;' /phpinc % /home/rasmus/php-src/branches/PHP_5_4/sapi/cli/php phpinc OK % /home/rasmus/php-src/branches/PHP_5_3/sapi/cli/php phpinc OK % php phpinc OK % cd /phptest % php phpinc OK What am I missing? This seems to be exactly the setup that thekid described. [2012-01-28 13:39:24] grobmeier at gmail dot com I can only agree with startup09. Please fix it. Thousands 11 (among others) customers are using old PHP because of this one. It is going to have birthday soon. I cannot upgrade my Open Source projects because 5.2 ist sill used on so many hosts. You need to get this done if you really have an interest your users migrate to 5.3. [2012-01-17 14:51:40] startup09 at web dot de please fix this! 11 still uses 5.2 for all customers because of this bug. I'm one of these poor people and can't use newer extensions which require 5.3 :( [2011-07-06 10:36:49] rainer at hosting-ist-mein-leben dot de In latest 5.4.0-alpha1 problem is still there. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=51860 -- Edit this bug report at https://bugs.php.net/bug.php?id=51860edit=1
Bug #51860 [Fbk]: Include fails with toplevel symlink to /
Edit report at http://bugs.php.net/bug.php?id=51860edit=1 ID: 51860 Updated by: the...@php.net Reported by: stephan dot suerken at 1und1 dot de Summary: Include fails with toplevel symlink to / Status: Feedback Type:Bug Package: Reproducible crash PHP Version: 5.3.2 New Comment: 1) Create a symlink in / to / r...@thekid:/ ln -s / phptest r...@thekid:/ ls -al /phptest lrwxr-xr-x 1 root wheel 1 May 21 10:40 /phptest - / 2) Verify r...@thekid:/ echo OK /phpfile r...@thekid:/ php -r 'include(/phptest/phpfile);' Expected result: OK 3) Clean up r...@thekid:/ rm /phptest /phpfile You need to be root because you're working in /, that's it:) Previous Comments: [2010-05-20 14:14:47] m...@php.net You think anybody's goind to untar something in his root AS root? Please provide some proper steps to reproduce, thank you. [2010-05-19 16:46:20] stephan dot suerken at 1und1 dot de Description: Tarball: http://stephan-suerken.de/tmp/php53include.tar.gz Hi, with a certain directory setup (symlink pointing to /, see file tree in php53include.tar.gz) plus script call syntax (see scripts ok and fail scripts in tarball), including a file meekly fails. I have not completely debugged it, but afaics php_resolve_path fails were it should not; I suspect some of the canonize path functions wrongly give an error here. Thanks, Stephan Test script: --- Steps to reproduce: 1. Download: http://stephan-suerken.de/tmp/php53include.tar.gz [as root] 2. cd / 3. tar xfz php53include.tar.gz 4. /phptest/fail Expected result: # manwe(CHROOT:sid-ui): /phptest # root? ./ok /phpinclude/inc123.php: OK, INCLUDED Actual result: -- # manwe(CHROOT:sid-ui): /phptest # root? ./fail PHP Warning: require(/phplink/phpinclude/inc123.php): failed to open stream: No such file or directory in /phptest/test.php on line 2 PHP Fatal error: require(): Failed opening required '/phplink/phpinclude/inc123.php' (include_path='.:/usr/share/php:/usr/share/pear') in /phptest/test.php on line 2 -- Edit this bug report at http://bugs.php.net/bug.php?id=51860edit=1