|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20514 change of behaviour of function getcwd() ?
Submitted: 2002-11-20 05:27 UTC Modified: 2002-12-01 16:56 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: erwan at barzhoneg dot com Assigned: ilia (profile)
Status: Not a bug Package: Directory function related
PHP Version: 4.3.0RC1 OS: win32
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: erwan at barzhoneg dot com
New email:
PHP Version: OS:


 [2002-11-20 05:27 UTC] erwan at barzhoneg dot com
It occurs on my IIS5/win2k/PHP4.3.0rc1 (from the binary distrib):
when I use an include , the function getcwd returns the directory of the include and not the directory of the main page.

in previous PHP versions, this was not the case : the getcwd() would always return the directory of the main page.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-20 05:53 UTC]
Yes, this is new and wanted.
getcwd is returning the current __FILE__ directory.
 [2002-11-20 06:16 UTC]
I couldn't find any related messages in php-dev@. when/where was this change discussed?
 [2002-11-20 06:18 UTC]
What is the exact name of the executable you use?
And can you run it with the -v option to show it?

 [2002-11-20 07:23 UTC]
This was discussed when we've got the bug in include() and require() with symlinks. Wez and ilia decided this if I'm remembering well.
 [2002-11-20 09:11 UTC] erwan at barzhoneg dot com
for info :

D:\php-4.3.0-Win32>php-cgi.exe -v
PHP 4.3.0RC1 (cgi-fcgi), Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies
 [2002-12-01 16:47 UTC]
Ilia practically begged to get this assigned to him..

 [2002-12-01 16:56 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

As most of us know Win32 does not have symlinks so that's clearly of no relevance to this bug report. The code in TSRM responsible for fetching the current directory via getcwd() has been the same since it was first written , revision (1.1). Thus, I must conclude that the behavior had NOT changed and therefor this bug is bogus.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 12 22:01:30 2024 UTC