From: samm at os2 dot kiev dot ua Operating system: FreeBSD 6 PHP version: 4.4.1 PHP Bug Type: Apache2 related Bug description: getcwd() return "/" when using with mod_rewrite
Description: ------------ When i use getcwd() function in my script which work with mod_rewrite i got "/" instead of real path. Without mod_rewrite redirection all work just fine. I check this with STABLE-200511101949 snapshot. With php 4.4.0 all work as expected. Reproduce code: --------------- To reproduce this bug do: 1) Enable mod_rewrite in apache2 config file 2) make .htaccess file with content like: RewriteEngine on RewriteRule ^test.html$ test.php [L] and place it in your virtual server root directory. 3) Create file "test.php" with content like <? echo getcwd() ?> and then point your browser to the "yoursever/test.html". Then try yoursever/test.php Expected result: ---------------- real path, same in 2 examples, e.g. /usr/home/samm/htdocs /usr/home/samm/htdocs Actual result: -------------- / /usr/home/samm/htdocs -- Edit bug report at http://bugs.php.net/?id=35186&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35186&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35186&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35186&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=35186&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35186&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35186&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35186&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35186&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35186&r=support Expected behavior: http://bugs.php.net/fix.php?id=35186&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35186&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35186&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35186&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35186&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35186&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35186&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35186&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35186&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35186&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35186&r=mysqlcfg