|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53898 PHAR reports invalid error message, when the directory does not exist
Submitted: 2011-02-01 09:55 UTC Modified: 2011-02-01 15:01 UTC
From: nightstorm at tlen dot pl Assigned: iliaa (profile)
Status: Closed Package: PHAR related
PHP Version: 5.3.5 OS: Arch Linux x86_64
Private report: No CVE-ID: None
 [2011-02-01 09:55 UTC] nightstorm at tlen dot pl
When we try to create a PHAR archive, and the directory, where we want to save it does not exist, PHAR complains about invalid file extension, instead of informing that there is a problem with accessing the requested location. This is a bit confusing.

Test script:
// assume that "./dummy/" does not exist.
$phar = new Phar('./dummy/archive.phar');

Expected result:
Cannot create phar './dummy/archive.phar', invalid path in pharbuild.php on line 2
(or something like that)

Actual result:
UnexpectedValueException: Cannot create phar './dummy/archive.phar', file extension (or combination) not recognised in pharbuild.php on line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-01 15:01 UTC]
Automatic comment from SVN on behalf of iliaa
Log: Fixed bug #53898 (PHAR reports invalid error message, when the directory does not exist).
 [2011-02-01 15:01 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa
 [2011-02-01 15:01 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 07:01:29 2024 UTC