PHP 7.4 PECL?

jayw1

Verified User
Joined
Nov 20, 2019
Messages
205
Location
USA
Hi,

Why is there no pecl under /usr/local/php74/bin ?
In the php74 directory there is.
I'm trying to install phpredis for PHP 7.4 and I am struggling.
 
PEAR is disabled by default on PHP 7.4. As "PECL is a repository of PHP extensions that are made available to you via the PEAR packaging system", it also removes the PECL too.

To enable PEAR (and PECL) you need to add "--with-pear" in the configure script and recompile PHP 7.4. Here is the changelog:


As for installation of phpredis, there is also a way to build it from source or from the OS repository:

 
Hello,

The pear/pecl will be installed as mentioned by user @wattie if you configure PHP 7.4 with the option --with-pear which is missing to my surprise by default.

If you use PHP-FPM, then copy /usr/local/directadmin/custombuild/configure/fpm/configure.php74 to /usr/local/directadmin/custombuild/custom/fpm/configure.php74 and add the line

Code:
--with-pear \

after

Code:
--with-pdo-mysql=mysqlnd \

and re-compile PHP.
 
I use OpenLiteSpeed with lsphp, what should I do in this scenario?
 
Copy /usr/local/directadmin/custombuild/configure/litespeed/configure.php74 to /usr/local/directadmin/custombuild/custom/litespeed/configure.php74

Create the destination folder if it's missing. And update the file as mentioned earlier.
 
Okay, those 2 steps are done. Now to rebuild PHP. I know I can /build php n but I only want to rebuild 7.4 instead of all installed versions to make this quicker. Is there a flag I can add to the command?
 
which is missing to my surprise by default.

In January this year there was a big hack on the pear website (the main installation package was replaced with malicious version with a trojan planted inside). That is not the reason but it triggered a discussion around it.

PEAR is not actively maintained and even updates for deprecation warnings are too slow to come live. The code is already too much legacy and the community thinks that it will go to a dead end. Disabling it now is a move forward to force people to search for alternatives.

See here: https://externals.io/message/103977
 
Okay, all done. There is no pecl file in /usr/local/php74/bin however.
There is phpize now, though.
 
It seems PHP 7.4 was not compiled with pear either.

'./configure' '--prefix=/usr/local/php74' '--program-suffix=74' '--enable-litespeed' '--with-config-file-scan-dir=/usr/local/php74/lib/php.conf.d' '--with-curl' '--enable-gd' '--with-gettext' '--with-jpeg' '--with-freetype' '--with-kerberos' '--with-openssl' '--with-mhash' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-sodium=/usr/local' '--with-webp' '--with-xsl' '--with-zlib' '--with-zip' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-soap' '--enable-mbstring' '--enable-intl' 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/icu/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig'
 
PHP (default) configuration file: /usr/local/directadmin/custombuild/configure/litespeed/configure.php74
PHP (additional) configuration file: /usr/local/directadmin/custombuild/configure/litespeed/configure.php73

I see my mistake. I copied the file to /configure/openlitespeed/ instead of /configure/litespeed/ - trying again
 
P.S. PEAR is considered outdated. It has lots of issues:

1. It install extensions only globally;
2. There is no dependency management;
3. All packages must be "pear reviewed" (the devs of extensions must always wait to be approved before pushing an update).

Most of the developers migrated to use Composer a long long long time ago. So briefly... PEAR is not a modern package manager. But it is "too big to die".

PEAR is still a deal in the hosting community because... well... it's just a very easy way for us to install packages globally simply because... it comes "out of the box". My opinion is that it this change in the default installation behavior is a good trigger for us to start searching for alternatives. PEAR will die sooner or later...
 
I know. I use it only to install igbinary and Redis, it's just the easiest way.
 
Hmm, having trouble installing igbinary and Redis for 7.4

Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in PEAR/Builder.php on line 407
PHP Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /usr/local/php74/lib/php/PEAR/Builder.php on line 407
 
I've ignored the Warning and got Redis installed:

Code:
# /usr/local/php74/bin/php -i | grep -i redis | head
redis
Redis Support => enabled
Redis Version => 5.1.1
redis.arrays.algorithm => no value => no value
redis.arrays.auth => no value => no value
redis.arrays.autorehash => 0 => 0
redis.arrays.connecttimeout => 0 => 0
redis.arrays.consistent => 0 => 0
redis.arrays.distributor => no value => no value
redis.arrays.functions => no value => no value
 
phpinfo reports no igbinary or Redis, I wonder if I've missed a step. Both extensions are listed in php.ini and I followed the same steps when I installed for 7.3. Hmm.
 
I'm trying to achieve the same thing. Compiling PHP7.4 with pear support went fine but I run into the following. What's going on here?

Code:
[root@vps scripts]# ./php-extension.sh install redis --php=74
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/redis.so (/usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/redis.so: cannot open shared object file: No such file or directory), /usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/redis.so.so (/usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/redis.so (/usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/redis.so: cannot open shared object file: No such file or directory), /usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/redis.so.so (/usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
No releases available for package "pecl.php.net/redis"
download failed
Failed to download a file

Code:
[root@vps scripts]# pear update-channels
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is not responding over http://, failed with message: Connection to `ssl://pear.php.net:443' failed:
Trying channel "pear.php.net" over https:// instead
Cannot retrieve channel.xml for channel "pear.php.net" (Connection to `ssl://pear.php.net:443' failed: )
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

Code:
[root@vps scripts]# pecl list-all

Notice: Trying to access array offset on value of type bool in PEAR/REST.php on line 181
PHP Notice:  Trying to access array offset on value of type bool in /usr/local/php74/lib/php/PEAR/REST.php on line 181
Connection to `ssl://pecl.php.net:443' failed:
 
Is there a method in custombuild to have pear enable by default? Doesn't make any sense we'd need custom options for this, many many additionals modules are installed with pecl :)
 
Is there a method in custombuild to have pear enable by default? Doesn't make any sense we'd need custom options for this, many many additionals modules are installed with pecl :)

Done in rev. 2372 :) Let's hope pickle becomes integrated into composer when PHP 8.0 comes out.
 
Back
Top