#35186 [Opn->Fbk]: getcwd() return "/" when using with mod_rewrite
| From: | sniper@php.net | Date: | Thu, 10 Nov 2005 21:53:45 +0000 |
| Subject: | #35186 [Opn->Fbk]: getcwd() return "/" when using with mod_rewrite | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-88010@lists.php.net to get a copy of this message | ||
ID: 35186
Updated by: sniper@php.net
Reported By: samm at os2 dot kiev dot ua
-Status: Open
+Status: Feedback
Bug Type: Apache2 related
Operating System: FreeBSD 6
PHP Version: 4.4.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Works fine for me.
Previous Comments:
------------------------------------------------------------------------
[2005-11-10 22:51:15] samm at os2 dot kiev dot ua
I forgot to say that i use php as shared Apache 2.0 module with apache
2.0.54
------------------------------------------------------------------------
[2005-11-10 22:46:47] samm at os2 dot kiev dot ua
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 this bug report at http://bugs.php.net/?id=35186&edit=1