PHP 7.4 PECL?

jayw1

New member
Joined
Nov 20, 2019
Messages
26
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.
 

wattie

Verified User
Joined
May 31, 2008
Messages
991
Location
Bulgaria
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:

 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,853
Location
GMT +7.00
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.
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,853
Location
GMT +7.00
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.
 

jayw1

New member
Joined
Nov 20, 2019
Messages
26
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?
 

wattie

Verified User
Joined
May 31, 2008
Messages
991
Location
Bulgaria
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
 

jayw1

New member
Joined
Nov 20, 2019
Messages
26
Okay, all done. There is no pecl file in /usr/local/php74/bin however.
There is phpize now, though.
 

jayw1

New member
Joined
Nov 20, 2019
Messages
26
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'
 

jayw1

New member
Joined
Nov 20, 2019
Messages
26
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
 

wattie

Verified User
Joined
May 31, 2008
Messages
991
Location
Bulgaria
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...
 

jayw1

New member
Joined
Nov 20, 2019
Messages
26
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
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,853
Location
GMT +7.00
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
 

jayw1

New member
Joined
Nov 20, 2019
Messages
26
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.
 
Top