php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78949 PEAR cannot find installed Archive/Tar.php
Submitted: 2019-12-12 09:27 UTC Modified: 2021-07-02 16:14 UTC
Votes:4
Avg. Score:3.8 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:3 (100.0%)
From: dries dot vints at gmail dot com Assigned: cmb (profile)
Status: Closed Package: *General Issues
PHP Version: 7.4.0 OS: macOS Catalina
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: dries dot vints at gmail dot com
New email:
PHP Version: OS:

 

 [2019-12-12 09:27 UTC] dries dot vints at gmail dot com
Description:
------------
When I try to install APCu with pecl on PHP 7.4 I get an error saying that PEAR cannot find Archive/Tar even though it's installed. The offset errors from below are from another bug which has already been resolved and should be in the next PHP patch release. I've installed PHP through Homebrew.

$ pecl install APCu

Notice: Trying to access array offset on value of type bool in REST.php on line 181
PHP Notice:  Trying to access array offset on value of type bool in /usr/local/Cellar/php/7.4.0/share/php/pear/PEAR/REST.php on line 181

Notice: Trying to access array offset on value of type bool in /usr/local/Cellar/php/7.4.0/share/php/pear/PEAR/REST.php on line 181
downloading apcu-5.1.18.tgz ...
Starting to download apcu-5.1.18.tgz (94,668 bytes)
.....................done: 94,668 bytes

Warning: require_once(Archive/Tar.php): failed to open stream: No such file or directory in PackageFile.php on line 304
PHP Warning:  require_once(Archive/Tar.php): failed to open stream: No such file or directory in /usr/local/Cellar/php/7.4.0/share/php/pear/PEAR/PackageFile.php on line 304

Warning: require_once(Archive/Tar.php): failed to open stream: No such file or directory in /usr/local/Cellar/php/7.4.0/share/php/pear/PEAR/PackageFile.php on line 304
PHP Fatal error:  require_once(): Failed opening required 'Archive/Tar.php' (include_path='/usr/local/Cellar/php/7.4.0/share/php/pear:/usr/local/Cellar/php/7.4.0/share/php/pear:/usr/local/Cellar/php/7.4.0/share/php/pear') in /usr/local/Cellar/php/7.4.0/share/php/pear/PEAR/PackageFile.php on line 304

Fatal error: require_once(): Failed opening required 'Archive/Tar.php' (include_path='/usr/local/Cellar/php/7.4.0/share/php/pear:/usr/local/Cellar/php/7.4.0/share/php/pear:/usr/local/Cellar/php/7.4.0/share/php/pear') in /usr/local/Cellar/php/7.4.0/share/php/pear/PEAR/PackageFile.php on line 304

Test script:
---------------
Run `pecl install APCu` on PHP 7.4


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-12 09:28 UTC] dries dot vints at gmail dot com
-: dries dot vints at gmai dot com +: dries dot vints at gmail dot com
 [2019-12-12 09:28 UTC] dries dot vints at gmail dot com
Updated email address
 [2019-12-13 09:51 UTC] nikic@php.net
Don't think this has any relation to the PECL archive extension, so I doubt anyone from PEAR will see this.

To check, /usr/local/Cellar/php/7.4.0/share/php/pear/Archive/Tar.php exists?
 [2019-12-13 10:12 UTC] cmb@php.net
-Package: archive +Package: *General Issues
 [2019-12-13 10:12 UTC] cmb@php.net
This is certainly unrelated to PECL/archive.
 [2019-12-13 11:00 UTC] dries dot vints at gmail dot com
Hmm, sorry about that. There wasn't a "PEAR" option in the "Package affected" list so I posted it under PECL which in hindsight maybe wasn't the best choice.
 [2019-12-13 18:01 UTC] drtechno at mail dot com
Well, it sounds like permission. execute under root alias. by executing:

sudo pecl install APCu

Most programs are deliberately restricted what they can access on a linux system, and in most cases, like installation, it required root privileges. Only use sudo and never log as root.
 [2019-12-13 18:23 UTC] drtechno at mail dot com
There are three ways, but it depends on your distro.

for Ubuntu, and other Debain type distros:

sudo apt-get update
sudo apt-get install php7.0-apcu -y

then sudo service php7.0-fpm restart (nginx) or sudo service apache2 reload

Debain-version has a configuration script


But on non debain systems that use apt-get, use this (which is the method you tried):

sudo apt-get update
sudo apt-get install php-pear -y
sudo pecl install apcu

add the plugin extension

echo "extension = apcu.so" | sudo tee -a /etc/php/7.0/mods-available/apcu.ini

Then add the symbol links for whatever webserver/service

Nginx (web and the command line interface (CLI) examples):
sudo ln -s /etc/php/7.0/mods-available/apcu.ini /etc/php/7.0/fpm/conf.d/30-apcu.ini
sudo ln -s /etc/php/7.0/mods-available/apcu.ini /etc/php/7.0/cli/conf.d/30-apcu.ini

Apache example:
sudo ln -s /etc/php/7.0/mods-available/apcu.ini /etc/php/7.0/apache2/conf.d/30-apcu.ini


then restart your web server:

sudo service php7.0-fpm restart (nginx) or sudo service apache2 reload (apache2)


The last way would be source code....

sudo apt-get update
sudo apt-get install php7.0-dev git build-essential -y
cd /tmp
git clone https://github.com/krakjoe/apcu
cd apcu
phpize
./configure
make
sudo make install

add the php extension:

echo "extension = apcu.so" | sudo tee -a /etc/php/7.0/mods-available/apcu.ini

Then add Symbol links:
for nginx:

sudo ln -s /etc/php/7.0/mods-available/apcu.ini /etc/php/7.0/fpm/conf.d/30-apcu.ini
sudo ln -s /etc/php/7.0/mods-available/apcu.ini /etc/php/7.0/cli/conf.d/30-apcu.ini

or for apache:

sudo ln -s /etc/php/7.0/mods-available/apcu.ini /etc/php/7.0/apache2/conf.d/30-apcu.ini

 then restart web server:

sudo php7.0-fpm restart

or
sudo service apache2 reload
 [2019-12-13 18:36 UTC] drtechno at mail dot com
I just noticing you are using macOS Catalina.

there are package managers like apt-get for the mac ( like Brew) but it would depend on if the author made it available in those BSD (macOs) channels.
 [2019-12-13 20:41 UTC] dries dot vints at gmail dot com
Hey drtechno, thanks for helping out, Yeah, I've installed PHP through Homebrew (see my first comment). I use brew to install PHP and then pecl or PEAR to install any extensions.
 [2019-12-14 19:02 UTC] cmb@php.net
> There wasn't a "PEAR" option in the "Package affected" list […]

That is because PEAR has its own bugtracker[1].  So if this is
indeed a bug in PEAR, it should probably be reported there.

[1] <https://pear.php.net/bugs/>
 [2019-12-16 11:43 UTC] dries dot vints at gmail dot com
> That is because PEAR has its own bugtracker[1].

Are you sure that issue tracker is still maintained? The youngest PHP version to report an issue with is 5.4. So I can't report an issue with 7.4.
 [2021-07-02 13:48 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-07-02 13:48 UTC] cmb@php.net
> Are you sure that issue tracker is still maintained?

I'm pretty sure that it's not. :(  However, having the ticket here
doesn't make much sense either.

Or has this been resolved in the meantime?
 [2021-07-02 14:25 UTC] dries at vints dot io
I have to admit that I totally lost track of this. I haven't used PEAR in ages.
 [2021-07-02 14:29 UTC] cmb@php.net
> I haven't used PEAR in ages.

Me neither, but this is about `pecl install APCu` which failed for
you with a PEAR related issue.
 [2021-07-02 16:03 UTC] dries at vints dot io
Seems to be resolved now! Thanks
                                                               ~
PEAR Version: 1.10.12
PHP Version: 8.0.7
Zend Engine Version: 4.0.7
 [2021-07-02 16:14 UTC] cmb@php.net
-Status: Feedback +Status: Closed
 [2021-07-02 16:14 UTC] cmb@php.net
Thanks for checking!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC