php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71317 PharData fails to open specific file
Submitted: 2016-01-09 00:25 UTC Modified: 2016-02-29 21:54 UTC
Votes:22
Avg. Score:4.6 ± 0.7
Reproduced:21 of 21 (100.0%)
Same Version:18 (85.7%)
Same OS:8 (38.1%)
From: weirdan at gmail dot com Assigned: nikic (profile)
Status: Closed Package: PHAR related
PHP Version: 7.0.2 OS: Debian/sid
Private report: No CVE-ID: None
 [2016-01-09 00:25 UTC] weirdan at gmail dot com
Description:
------------
There's a tar file that PharData fails to open: http://download.pear.php.net/package/Structures_Graph-1.1.1.tgz (either gzipped or ungzipped).

It works with php 5.3 (vanilla), 5.6 (debian build), but fails starting with php 7.0.{0,1,2} (all vanilla versions from php.net)

If I repack the archive (unpack and pack it back with tar cvf) it works fine. At first I thought the cause of the problem was that the archive did not include directories, but other similar archive (also without folder entries) http://download.pear.php.net/package/Console_CommandLine-1.2.1.tgz opens just fine.

Test script:
---------------
#!/bin/bash
for ver in 5.3.29 system 7.0.0 7.0.1 7.0.2; do 
  phpenv local $ver
  php -r 'echo phpversion() . "\n"; new \PharData("bad/Structures_Graph-1.1.1.tar");'
done

Expected result:
----------------
5.3.29
5.6.16-4
7.0.0
7.0.1
7.0.2

Actual result:
--------------
5.3.29
5.6.16-4
7.0.0
PHP Fatal error:  Uncaught UnexpectedValueException: phar error: tar-based phar "Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot be registered in Command line code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
  thrown in Command line code on line 1
7.0.1
PHP Fatal error:  Uncaught UnexpectedValueException: phar error: tar-based phar "Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot be registered in Command line code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
  thrown in Command line code on line 1
7.0.2
PHP Fatal error:  Uncaught UnexpectedValueException: phar error: tar-based phar "Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot be registered in Command line code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
  thrown in Command line code on line 1


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-14 00:31 UTC] chris dot kingslynne at gmail dot com
I noticed this issue and posted about it here:

https://stackoverflow.com/questions/34667830/does-using-composer-to-install-pear-packages-work-in-php-7

This appears to critically affect the ability to use Composer under PHP 7 :(

Chris
 [2016-01-28 05:15 UTC] smcjones at gmail dot com
I would add that I did not have this issue when I downloaded PHP 7.0. I did not test PHP 7.0.1, but I believe that the original PHP7 codebase did not contain this error.
 [2016-01-28 16:00 UTC] zk at imc-web dot de
I have the same issue using arch Linux, so this is not only a Debian issue.
PHP 7 is default in arch linux now, so composer is broken on it.
 [2016-02-10 21:13 UTC] fb at felix-blanke dot de
Same problem with php 7.0.3 on Gentoo. Composer isn't going anywhere because of this.
 [2016-02-12 19:41 UTC] doktor1360 at gmail dot com
Same problem with php 7.0.2 on CentOS 7.2.1511 - ius-community (build php70u)
 [2016-02-17 08:50 UTC] euskadi31 at gmail dot com
Same problem with php 7.0.3 on Ubuntu. Composer isn't going anywhere because of this.

uname: Linux scw-3c69c4 3.2.34-30 #17 SMP Mon Apr 13 15:53:45 UTC 2015 armv7l armv7l armv7l GNU/Linux


PHP 7.0.3-4+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
 [2016-02-29 21:54 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC