From: dzlatanov at softproekt dot com
Operating system: Linux / Windows
PHP version: 5.2.11
PHP Bug Type: *Directory/Filesystem functions
Bug description: Strange realpath() behavior in shutdown functions
Description:
------------
I noticed that realpath() function does not return the same result when
called during the regular script execution and in the shutdown process.
This behavior only appears when PHP is running as Apache module, but not
in CGI/FastCGI mode.
Tested with PHP 5.2.6, 5.3.0, 4.4.8.
Reproduce code:
---------------
<?php
function MyShutdownFunc() {
echo realpath("./") . "<br />";
}
MyShutdownFunc();
register_shutdown_function("MyShutdownFunc");
?>
Expected result:
----------------
/www/mysite.com/staging/root
/www/mysite.com/staging/root
Actual result:
--------------
/www/mysite.com/staging/root
/
--
Edit bug report at http://bugs.php.net/?id=50386&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50386&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50386&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50386&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50386&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50386&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50386&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50386&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50386&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50386&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50386&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50386&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50386&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50386&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50386&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50386&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50386&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50386&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50386&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50386&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50386&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50386&r=mysqlcfg