PHP 4.0 Bug #4766: function "require" ignore directory change with chdir
| From: | xrr at altern dot org | Date: | Thu, 01 Jun 2000 21:15:28 +0000 |
| Subject: | PHP 4.0 Bug #4766: function "require" ignore directory change with chdir | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20012@lists.php.net to get a copy of this message | ||
From: xrr@altern.org
Operating system: Linux 2.2.12
PHP version: 4.0.0 Release
PHP Bug Type: Misbehaving function
Bug description: function "require" ignore directory change with chdir
In php 3.0 using the chdir function before a "include" was changing the used directory.
Not anymore.
So instead of :
chdir ('../');
require 'global.inc';
you need to use
require '../global.inc';
This is only annoying if you have cascaded "include" statements. For exemple if in
global.inc I have a require 'tralala.inc' php4 will look for tralala in the first
directory even if I used chdir before (php3 was caring of the chdir)