php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46939 fatal error on new Phar
Submitted: 2008-12-24 16:06 UTC Modified: 2008-12-25 17:56 UTC
From: lunter at interia dot pl Assigned: cellog (profile)
Status: Not a bug Package: PHAR related
PHP Version: 5.3.0alpha3 OS: WinXP
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lunter at interia dot pl
New email:
PHP Version: OS:

 

 [2008-12-24 16:06 UTC] lunter at interia dot pl
Description:
------------
This PHP code triggers:

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar 'core.php', file extension (or combination) not recognised' in C:\htdocs\a\!phar2.php:2 Stack trace: #0 C:\htdocs\a\!phar2.php(2): Phar->__construct('core.php') #1 {main} thrown in C:\htdocs\a\!phar2.php on line 2

but *.php files work as good as *.phar

when using:
1) http://web.com/file.php/index.php
2) require('phar://file.php');

Reproduce code:
---------------
<?
 $p=new Phar('core.php');
?>

Expected result:
----------------
NO Fatal error wheh extension is *.php (*.php5, *.php6)

Actual result:
--------------
Fatal error wheh extension is *.php (*.php5, *.php6)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-25 04:33 UTC] cellog@php.net
This is an intended side effect.  .zip and .tar-based phar archives will not work if .phar is not in the name, and so allowing creation of them is not allowed.  If we allowed this for phar-based phar archives, it would be inconsistent and confusing.

We are, of course, in alpha stage, but it would be a major change to do this.

What is the workaround?

blah.phar.php or blah.phar.php5 or blah.phar.php6 all work.  If you would like to discuss alternatives, I am happy to do so, either on internals@lists.php.net or through email at cellog@php.net
 [2008-12-25 17:56 UTC] lunter at interia dot pl
OK,
I dont't know that *.phar.* are allowed.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 12:01:29 2025 UTC