Bug #74585 [Opn->Nab]: chroot doesn't change __DIR__ constant
| From: | dm@php.net | Date: | Fri, 12 May 2017 20:29:19 +0000 |
| Subject: | Bug #74585 [Opn->Nab]: chroot doesn't change __DIR__ constant | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209091@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74585&edit=1
ID: 74585
Updated by: dm@php.net
Reported by: joomla at itronic dot at
Summary: chroot doesn't change __DIR__ constant
-Status: Open
+Status: Not a bug
Type: Bug
Package: CGI/CLI related
Operating System: Linux
PHP Version: 7.0.19
Block user comment: N
Private report: N
New Comment:
> __DIR__ The directory of the file.
It is not affected by chdir(), as expected, maybe you're looking for getcwd().
Previous Comments:
------------------------------------------------------------------------
[2017-05-12 19:28:15] joomla at itronic dot at
Description:
------------
If you change the root dir, the __DIR__ doesn't reflect the change. Maybe this effects other
Magic constants.
Test script:
---------------
chroot('/tmp');
echo __DIR__;
Expected result:
----------------
__DIR__ should have the correct path.
Actual result:
--------------
The old path
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74585&edit=1