|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35661 Object-element-functions does not handle directories correctly
Submitted: 2005-12-13 19:46 UTC Modified: 2005-12-13 20:23 UTC
From: marscel at pcreact dot de Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.1.1 OS: Windows XP SP1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: marscel at pcreact dot de
New email:
PHP Version: OS:


 [2005-12-13 19:46 UTC] marscel at pcreact dot de
I have a member function which is been called in the destructor of this object. The called function has to write a string into a file, which shall be stored in a subdirectory. 
In my case its F:\php\logs (php is the dir where the script is stored, in the \logs dir shall the created file be stored). The first problem I recognized was that PHP can't read the current directory in the function, the second one is that it creates files in a totally different directory. If I tell this function "mkdir("./logs/");", it won't create a subdir called "logs" in F:\php, but in D:\ (-> D:\logs)! 
If I write the absolute directory, the thing works, but it's useless on a webspace.
My php.ini hasn't set anything to D:\ just PHP is installed in D:\php\

Reproduce code:
class someclass
{   // Constructors, functions, vars...
    public function someclass_make_file($mode)    {
        if(defined('DEBUG_LOG')) { 
			switch($mode)  { 
				case 3:
	  $dl = $this->debug_log;  // "Info"
	  $dfl = fopen("logs/".time().".txt", "a");
        fwrite($dfl, $dl);
		return true;
    public funtion __construct()

Expected result:
A file F:\php\logs\1134123412.txt

Actual result:
A file D:\logs\1134123412.txt or non has been created.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-13 20:23 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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jan 24 10:01:24 2021 UTC