ID:               19552
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         Apache2 related
 Operating System: linux
 PHP Version:      4.2.3
 New Comment:

There was a bug with virtual directory support in 4.2.3 used with
multithreaded web servers. It's been fixed in both STABLE and HEAD
branches.

You should not rely on environment for CWD in a multithreaded server,
since all threads share the same. The directory you're getting is
probably the one you were in when starting Apache2. Use getcwd()
instead.


Previous Comments:
------------------------------------------------------------------------

[2002-09-24 16:18:31] [EMAIL PROTECTED]

it causes php scripts to not run.  the problem isn't that $_ENV['PWD']
is wrong, it's that php looks in the wrong place for files to include.

if I "include 'foo.php';"  it will look for it in
/home/sproctor/php-xxx instead of from the location of the file.

The CGI version works fine, the apache1 version works fine, the apache2
version fails.  It's not too big of a deal for me thought because we
have the CGI version working.

Perhaps it's a bug in apache2, either way PHP seems rather unusable as
an apache2 module right now.

Thanks for the help,
Sean

------------------------------------------------------------------------

[2002-09-24 15:56:13] [EMAIL PROTECTED]

This might be for one of two reasons, this was the dir you started
apache from, or it might be a bug in apache2. I cannot see how this bug
comes from PHP. 

The variables' and the values for them are taken directly from the
server or environment variables provided to PHP.

Bogusify.

- James

------------------------------------------------------------------------

[2002-09-24 15:27:12] [EMAIL PROTECTED]

I tried the latest version.  now $_ENV['PWD'] is just
/home/sproctor/php4-200209240900.  I imagine it's an apache2 issue
because that's the only weird thing I'm doing.  apache2 works fine on
our server for everything else.  I'll try building it as a CGI and see
if that works.

------------------------------------------------------------------------

[2002-09-23 05:27:48] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip



------------------------------------------------------------------------

[2002-09-22 16:53:11] [EMAIL PROTECTED]

$_ENV['PWD'] always returns /home/sproctor/php-4.2.3 (where php was
compiled).  I expect it to be /var/www/reliance/pn (where the script is
run from).  I compiled php with apxs2 and apache 2.0.40.

It's not just the variable that's wrong, but doing something like
include "filename" will search in /home/sproctor/php-4.2.3, for
clarity.

Thanks!

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19552&edit=1

Reply via email to