php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51806 chdir wont'work on phar files
Submitted: 2010-05-13 10:19 UTC Modified: 2015-03-30 18:56 UTC
Votes:6
Avg. Score:4.7 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:2 (33.3%)
From: goetas at lignano dot it Assigned:
Status: Not a bug Package: PHAR related
PHP Version: 5.3.2 OS: Slackware
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: goetas at lignano dot it
New email:
PHP Version: OS:

 

 [2010-05-13 10:19 UTC] goetas at lignano dot it
Description:
------------
cant change current working directory into phar package file

Test script:
---------------
<?php


$p = new Phar('test.tar.phar');

$p['index.php'] = '<?php var_dump(__DIR__); echo "\\n"; var_dump(chdir(__DIR__)); ?>';

include 'phar://test.tar.phar/index.php';





Expected result:
----------------
string(50) "phar:///mnt/md1/www/htdocs/test/phar/test.tar.phar"

bool(true)


Actual result:
--------------
string(50) "phar:///mnt/md1/www/htdocs/test/phar/test.tar.phar"

<br />
<b>Warning</b>:  chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in <b>phar:///mnt/md1/www/htdocs/test/phar/test.tar.phar/indxed.php</b> on line <b>1</b><br />
bool(false)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-15 16:01 UTC] felipe@php.net
Probably related to #52769
 [2015-03-30 18:56 UTC] mike@php.net
-Status: Open +Status: Not a bug
 [2015-03-30 18:56 UTC] mike@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

phar:// streams are virtual, yet they give you the feeling of something real.
Would you expect chdir("http://example.com/foo") to succeed?
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Aug 09 17:01:23 2020 UTC