[TUTORIAL] How to install any PHP modules using PEAR Package Manager

Hello!

This tutorial is an extension of Install/Uninstall PHP Extensions (pun not intended) for users who do not find the PHP extensions they need under Server > PHP > Install Extensions or find the module they need in the LiteSpeed repository.

PEAR package manager can also be used to to manage PECL extensions.

# change lsphp74 to any php version you have installed as default
$ cd /usr/local/lsws/lsphp74/bin
$ wget http://pear.php.net/go-pear.phar
$ ./lsphp go-pear.phar

then, using zip extension for example, run:

# install latest version of zip
$ /usr/local/lsws/lsphp74/bin/pecl install zip
# install specific version of zip
$ /usr/local/lsws/lsphp74/bin/pecl install zip-1.21.1

In your website create a php file e.g. info.php with the following contents:

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

Run the file e.g. http://mywebsite.net/info.php

You should expect this result:

If you need to install any other extension find them here and here or run this command:

# change zip with any package you want to lookup
$ /usr/local/lsws/lsphp74/bin/pecl search zip

For PEAR extensions configure the extension after installation:

UBUNTU

$ sudo echo "extension=imagick.so" >> /usr/local/lsws/lsphp74/etc/php/7.4/mods-available/40-imagick.ini

ALMALINUX

$ sudo echo "extension=imagick.so" >> /usr/local/lsws/lsphp74/etc/php.d/40-imagick.ini

Restart PHP

Option 1: Go to https://SERVER_URL/managephp/installExtensions > Choose the PHP version you installed extensions for > Click on Restart PHP

Option 2: In SSH Terminal run command touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt && systemctl restart lsws

1 Like

Hello Joseph,

I am trying to install mail, mail_mime and mail_mimedecode

These are the commands i have run

cd /usr/local/lsws/lsphp74/bin

wget Source of ', htmlspecialchars($_GET['viewsource']), '

./lsphp go-pear.phar

/usr/local/lsws/lsphp74/bin/pear install mail

/usr/local/lsws/lsphp74/bin/pear install mail mail_mime

/usr/local/lsws/lsphp74/bin/pear install mail mail_mimedecode

All installed however in my php.ini they do not show installed
i have also run php -m and again they do not show installed.
running the install commands again shows they are installed already.

Hello @craig

Kindly check the tutorial I have added how to configure PEAR extensions after installation.

Thanks Joseph,

All now working :+1:
Initially i thought i still had an issue but realised my php file needed the path to php changing.
If anyone else needs it in the future the path to php is

/usr/share/php

For Manual Installation from the source code

I am getting an error. Do you know how to handle this:

/usr/local/lsws/lsphp81/bin/pecl install zip

PHP Warning: PHP Startup: Unable to load dynamic library ‘zip’ (tried: /usr/local/lsws/lsphp81/lib64/php/modules/zip (/usr/local/lsws/lsphp81/lib64/php/modules/zip: cannot open shared object file: No such file or directory), /usr/local/lsws/lsphp81/lib64/php/modules/zip.so (/usr/local/lsws/lsphp81/lib64/php/modules/zip.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
downloading zip-1.21.1.tgz …
Starting to download zip-1.21.1.tgz (358,030 bytes)
…done: 358,030 bytes
24 source files, building
running: phpize
Configuring for:
PHP Api Version: 20210902
Zend Module Api No: 20210902
Zend Extension Api No: 420210902
building in /usr/local/lsws/lsphp74/tmp/pear-build-rootCFCGc4/zip-1.21.1
running: /usr/local/lsws/lsphp74/tmp/zip/configure --with-php-config=/usr/local/lsws/lsphp81/bin/php-config
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for a sed that does not truncate output… /bin/sed
checking for pkg-config… /bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking for cc… cc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether cc accepts -g… yes
checking for cc option to accept ISO C89… none needed
checking how to run the C preprocessor… cc -E
checking for icc… no
checking for suncc… no
checking for system library directory… lib
checking if compiler supports -Wl,-rpath,… yes
checking build system type… x86_64-pc-linux-gnu
checking host system type… x86_64-pc-linux-gnu
checking target system type… x86_64-pc-linux-gnu
checking for PHP prefix… /usr/local/lsws/lsphp81
checking for PHP includes… -I/usr/local/lsws/lsphp81/include/php -I/usr/local/lsws/lsphp81/include/php/main -I/usr/local/lsws/lsphp81/include/php/TSRM -I/usr/local/lsws/lsphp81/include/php/Zend -I/usr/local/lsws/lsphp81/include/php/ext -I/usr/local/lsws/lsphp81/include/php/ext/date/lib
checking for PHP extension directory… /usr/local/lsws/lsphp81/lib64/php/modules
checking for PHP installed headers prefix… /usr/local/lsws/lsphp81/include/php
checking if debug is enabled… no
checking if zts is enabled… no
checking for gawk… gawk
checking for zip archive read/writesupport… yes, shared
checking libzip… yes
checking PHP version… 8.1/8.2
checking for pkg-config… /bin/pkg-config
checking for libzip… configure: error: system libzip must be upgraded to version >= 0.11
ERROR: `/usr/local/lsws/lsphp74/tmp/zip/configure --with-php-config=/usr/local/lsws/lsphp81/bin/php-config’ failed

What are you trying to do here? You cannot configure a module with different php version for another php version. Do you want to install for php7.4 ? Use php7.4 in all your commands etc

I want to configure zip for php8.1 with this command: /usr/local/lsws/lsphp81/bin/pecl install zip
I don’t know why it comes up with the lsphb74.

Did you do this part

I just did that, restarted and I am still getting these:

checking for libzip… configure: error: system libzip must be upgraded to version >= 0.11
ERROR: `/usr/local/lsws/lsphp74/tmp/zip/configure --with-php-config=/usr/local/lsws/lsphp81/bin/php-config’ failed

I rebuilt the server with almalinux 8 and now everything is working as it should

I need gRPC extension after running /usr/local/lsws/lsphp81/bin/pecl install gRPC

it say ERROR: `make' failed

here is the log:

/usr/local/lsws/lsphp81/bin/pecl install gRPC
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading grpc-1.53.0.tgz ...
Starting to download grpc-1.53.0.tgz (5,563,066 bytes)
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................done: 5,563,066 bytes
2642 source files, building
running: phpize
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
building in /usr/local/lsws/lsphp74/tmp/pear-build-root9nMBZw/grpc-1.53.0
running: /usr/local/lsws/lsphp74/tmp/grpc/configure --with-php-config=/usr/local/lsws/lsphp81/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local/lsws/lsphp81
checking for PHP includes... -I/usr/local/lsws/lsphp81/include/php -I/usr/local/lsws/lsphp81/include/php/main -I/usr/local/lsws/lsphp81/include/php/TSRM -I/usr/local/lsws/lsphp81/include/php/Zend -I/usr/local/lsws/lsphp81/include/php/ext -I/usr/local/lsws/lsphp81/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lsws/lsphp81/lib64/php/modules
checking for PHP installed headers prefix... /usr/local/lsws/lsphp81/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable grpc support... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
libtool.m4: error: problem compiling CXX test program
checking for g++ option to produce PIC...  -DPIC
checking if g++ PIC flag  -DPIC works... no
checking if g++ static flag  works... no
checking if g++ supports -c -o file.o... no
checking if g++ supports -c -o file.o... (cached) no
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/sh /usr/local/lsws/lsphp74/tmp/pear-build-root9nMBZw/grpc-1.53.0/libtool --mode=compile g++ -I. -I/usr/local/lsws/lsphp74/tmp/grpc -I/usr/local/lsws/lsphp74/tmp/pear-build-root9nMBZw/grpc-1.53.0/include -I/usr/local/lsws/lsphp74/tmp/pear-build-root9nMBZw/grpc-1.53.0/main -I/usr/local/lsws/lsphp74/tmp/grpc -I/usr/local/lsws/lsphp81/include/php -I/usr/local/lsws/lsphp81/include/php/main -I/usr/local/lsws/lsphp81/include/php/TSRM -I/usr/local/lsws/lsphp81/include/php/Zend -I/usr/local/lsws/lsphp81/include/php/ext -I/usr/local/lsws/lsphp81/include/php/ext/date/lib -I/usr/local/lsws/lsphp74/tmp/grpc/include -I/usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/upb-generated -I/usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/upbdefs-generated -I/usr/local/lsws/lsphp74/tmp/grpc/src/php/ext/grpc -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/abseil-cpp -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/address_sorting/include -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/boringssl-with-bazel/src/include -I/usr/local/lsws/l
sphp74/tmp/grpc/third_party/re2 -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/upb -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/xxhash  -DHAVE_CONFIG_H  -std=c++14 -fno-exceptions -fno-rtti -g -O2   -fvisibility=hidden     -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN     -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0     -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1     -DGRPC_XDS_USER_AGENT_NAME_SUFFIX='"PHP"'     -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"1.53.0"' -DZEND_COMPILE_DL_EXT=1 -c /usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/filters/backend_metrics/backend_metric_filter.cc -o src/core/ext/filters/backend_metrics/backend_metric_filter.lo  -MMD -MF src/core/ext/filters/backend_metrics/backend_metric_filter.dep -MT src/core/ext/filters/backend_metrics/backend_metric_filter.lo
libtool: compile:  g++ -I. -I/usr/local/lsws/lsphp74/tmp/grpc -I/usr/local/lsws/lsphp74/tmp/pear-build-root9nMBZw/grpc-1.53.0/include -I/usr/local/lsws/lsphp74/tmp/pear-build-root9nMBZw/grpc-1.53.0/main -I/usr/local/lsws/lsphp74/tmp/grpc -I/usr/local/lsws/lsphp81/include/php -I/usr/local/lsws/lsphp81/include/php/main -I/usr/local/lsws/lsphp81/include/php/TSRM -I/usr/local/lsws/lsphp81/include/php/Zend -I/usr/local/lsws/lsphp81/include/php/ext -I/usr/local/lsws/lsphp81/include/php/ext/date/lib -I/usr/local/lsws/lsphp74/tmp/grpc/include -I/usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/upb-generated -I/usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/upbdefs-generated -I/usr/local/lsws/lsphp74/tmp/grpc/src/php/ext/grpc -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/abseil-cpp -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/address_sorting/include -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/boringssl-with-bazel/src/include -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/re2 -I/usr/local/lsws/lsphp74/tmp/grpc/third_p
arty/upb -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/xxhash -DHAVE_CONFIG_H -std=c++14 -fno-exceptions -fno-rtti -g -O2 -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 -DGRPC_XDS_USER_AGENT_NAME_SUFFIX=\"PHP\" -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX=\"1.53.0\" -DZEND_COMPILE_DL_EXT=1 -c /usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/filters/backend_metrics/backend_metric_filter.cc -MMD -MF src/core/ext/filters/backend_metrics/backend_metric_filter.dep -MT src/core/ext/filters/backend_metrics/backend_metric_filter.lo
ERROR: `make' failed

Ramadhan Mubrark @salarpro

This is where the issue is. You installed pear the provisional way for php7.4 instead of php8.1

Ramadan Kareem @josephgodwinke . first I’m new to this. but I tried installing zip at first and it works but after that, I tried gRPC it said make failed, is there any way to uninstall from 7.4 .

You can install for php 8.1 easily using

## specify the installtion
$ ln -s /usr/local/lsws/lsphp81/bin/php-config /usr/bin/php-config
$ ln -s /usr/local/lsws/lsphp81/bin/phpize /usr/bin/phpize
## install pear
$ cd /usr/local/lsws/lsphp81/bin
$ wget http://pear.php.net/go-pear.phar
$ ./lsphp go-pear.phar
$ /usr/local/lsws/lsphp81/bin/pecl install grpc
$ echo "extension=grpc.so" >> /usr/local/lsws/lsphp81/etc/php.d/grpc.ini

This is my terminal running your commands

[root@fastday-server ~]# ln -s /usr/local/lsws/lsphp81/bin/php-config /usr/bin/php-config
ln: failed to create symbolic link ‘/usr/bin/php-config’: File exists
[root@fastday-server ~]# ln -s /usr/local/lsws/lsphp81/bin/php-config /usr/bin/php-config -f
[root@fastday-server ~]# ln -s /usr/local/lsws/lsphp81/bin/phpize /usr/bin/phpize
ln: failed to create symbolic link ‘/usr/bin/phpize’: File exists
[root@fastday-server ~]# ln -s /usr/local/lsws/lsphp81/bin/phpize /usr/bin/phpize -f
[root@fastday-server ~]# cd /usr/local/lsws/lsphp81/bin
[root@fastday-server bin]# wget http://pear.php.net/go-pear.phar
--2023-03-29 19:56:28--  http://pear.php.net/go-pear.phar
Resolving pear.php.net (pear.php.net)... 109.203.101.62
Connecting to pear.php.net (pear.php.net)|109.203.101.62|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://pear.php.net/go-pear.phar [following]
--2023-03-29 19:56:28--  https://pear.php.net/go-pear.phar
Connecting to pear.php.net (pear.php.net)|109.203.101.62|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3628817 (3.5M)
Saving to: ‘go-pear.phar.7’

100%[================================================================================================================================================================================================================================================================================================================>] 3,628,817   4.16MB/s   in 0.8s   

2023-03-29 19:56:29 (4.16 MB/s) - ‘go-pear.phar.7’ saved [3628817/3628817]

[root@fastday-server bin]# ./lsphp go-pear.phar
PHP Warning:  Private methods cannot be final as they are never overridden by other classes in /usr/local/lsws/lsphp81/bin/go-pear.phar on line 339

Warning: Private methods cannot be final as they are never overridden by other classes in /usr/local/lsws/lsphp81/bin/go-pear.phar on line 339

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /usr/local/lsws/lsphp81
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/local/lsws/lsphp81/bin
 5. PHP code directory ($php_dir)                 : /usr/local/lsws/lsphp81/share/pear
 6. Documentation directory                       : /usr/local/lsws/lsphp81/docs
 7. Data directory                                : /usr/local/lsws/lsphp81/data
 8. User-modifiable configuration files directory : /usr/local/lsws/lsphp81/cfg
 9. Public Web Files directory                    : /usr/local/lsws/lsphp81/www
10. System manual pages directory                 : /usr/local/lsws/lsphp81/man
11. Tests directory                               : /usr/local/lsws/lsphp81/tests
12. Name of configuration file                    : /usr/local/lsws/lsphp81/etc/pear.conf

1-12, 'all' or Enter to continue: all
Installation base ($prefix) [/usr/local/lsws/lsphp81] : 
Temporary directory for processing [/tmp/pear/install] : 
Temporary directory for downloads [/tmp/pear/install] : 
Binaries directory [$prefix/bin] : 
PHP code directory ($php_dir) [$prefix/share/pear] : 
Documentation directory [$prefix/docs] : 
Data directory [$prefix/data] : 
User-modifiable configuration files directory [$prefix/cfg] : 
Public Web Files directory [$prefix/www] : 
System manual pages directory [$prefix/man] : 
Tests directory [$prefix/tests] : 
Name of configuration file [/usr/local/lsws/lsphp81/etc/pear.conf] : 

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /usr/local/lsws/lsphp81
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/local/lsws/lsphp81/bin
 5. PHP code directory ($php_dir)                 : /usr/local/lsws/lsphp81/share/pear
 6. Documentation directory                       : /usr/local/lsws/lsphp81/docs
 7. Data directory                                : /usr/local/lsws/lsphp81/data
 8. User-modifiable configuration files directory : /usr/local/lsws/lsphp81/cfg
 9. Public Web Files directory                    : /usr/local/lsws/lsphp81/www
10. System manual pages directory                 : /usr/local/lsws/lsphp81/man
11. Tests directory                               : /usr/local/lsws/lsphp81/tests
12. Name of configuration file                    : /usr/local/lsws/lsphp81/etc/pear.conf

1-12, 'all' or Enter to continue: 
Beginning install...
Configuration written to /usr/local/lsws/lsphp81/etc/pear.conf...
Initialized registry...
Preparing to install...
installing phar:///usr/local/lsws/lsphp81/bin/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.14.tar...
installing phar:///usr/local/lsws/lsphp81/bin/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.3.tar...
installing phar:///usr/local/lsws/lsphp81/bin/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.13.tar...
installing phar:///usr/local/lsws/lsphp81/bin/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.tar...
installing phar:///usr/local/lsws/lsphp81/bin/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.4.5.tar...
warning: pear/PEAR dependency package "pear/Archive_Tar" downloaded version 1.4.14 is not the recommended version 1.4.4
install ok: channel://pear.php.net/Archive_Tar-1.4.14
install ok: channel://pear.php.net/Console_Getopt-1.4.3
install ok: channel://pear.php.net/Structures_Graph-1.1.1
install ok: channel://pear.php.net/XML_Util-1.4.5
install ok: channel://pear.php.net/PEAR-1.10.13
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

** WARNING! Old version found at /usr/local/lsws/lsphp81/bin, please remove it or be sure to use the new /usr/local/lsws/lsphp81/bin/pear command

The 'pear' command is now at your service at /usr/local/lsws/lsphp81/bin/pear

** The 'pear' command is not currently in your PATH, so you need to
** use '/usr/local/lsws/lsphp81/bin/pear' until you have added
** '/usr/local/lsws/lsphp81/bin' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

  http://pear.php.net/faq.php
  http://pear.php.net/manual/

Thanks for using go-pear!

[root@fastday-server bin]# /usr/local/lsws/lsphp81/bin/pecl install grpc
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading grpc-1.53.0.tgz ...
Starting to download grpc-1.53.0.tgz (5,563,066 bytes)
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................done: 5,563,066 bytes
2642 source files, building
running: phpize
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
building in /usr/local/lsws/lsphp74/tmp/pear-build-rootAUVQbV/grpc-1.53.0
running: /usr/local/lsws/lsphp74/tmp/grpc/configure --with-php-config=/usr/local/lsws/lsphp81/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local/lsws/lsphp81
checking for PHP includes... -I/usr/local/lsws/lsphp81/include/php -I/usr/local/lsws/lsphp81/include/php/main -I/usr/local/lsws/lsphp81/include/php/TSRM -I/usr/local/lsws/lsphp81/include/php/Zend -I/usr/local/lsws/lsphp81/include/php/ext -I/usr/local/lsws/lsphp81/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lsws/lsphp81/lib64/php/modules
checking for PHP installed headers prefix... /usr/local/lsws/lsphp81/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable grpc support... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
libtool.m4: error: problem compiling CXX test program
checking for g++ option to produce PIC...  -DPIC
checking if g++ PIC flag  -DPIC works... no
checking if g++ static flag  works... no
checking if g++ supports -c -o file.o... no
checking if g++ supports -c -o file.o... (cached) no
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/sh /usr/local/lsws/lsphp74/tmp/pear-build-rootAUVQbV/grpc-1.53.0/libtool --mode=compile g++ -I. -I/usr/local/lsws/lsphp74/tmp/grpc -I/usr/local/lsws/lsphp74/tmp/pear-build-rootAUVQbV/grpc-1.53.0/include -I/usr/local/lsws/lsphp74/tmp/pear-build-rootAUVQbV/grpc-1.53.0/main -I/usr/local/lsws/lsphp74/tmp/grpc -I/usr/local/lsws/lsphp81/include/php -I/usr/local/lsws/lsphp81/include/php/main -I/usr/local/lsws/lsphp81/include/php/TSRM -I/usr/local/lsws/lsphp81/include/php/Zend -I/usr/local/lsws/lsphp81/include/php/ext -I/usr/local/lsws/lsphp81/include/php/ext/date/lib -I/usr/local/lsws/lsphp74/tmp/grpc/include -I/usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/upb-generated -I/usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/upbdefs-generated -I/usr/local/lsws/lsphp74/tmp/grpc/src/php/ext/grpc -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/abseil-cpp -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/address_sorting/include -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/boringssl-with-bazel/src/include -I/usr/local/lsws/l
sphp74/tmp/grpc/third_party/re2 -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/upb -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/xxhash  -DHAVE_CONFIG_H  -std=c++14 -fno-exceptions -fno-rtti -g -O2   -fvisibility=hidden     -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN     -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0     -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1     -DGRPC_XDS_USER_AGENT_NAME_SUFFIX='"PHP"'     -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"1.53.0"' -DZEND_COMPILE_DL_EXT=1 -c /usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/filters/backend_metrics/backend_metric_filter.cc -o src/core/ext/filters/backend_metrics/backend_metric_filter.lo  -MMD -MF src/core/ext/filters/backend_metrics/backend_metric_filter.dep -MT src/core/ext/filters/backend_metrics/backend_metric_filter.lo
libtool: compile:  g++ -I. -I/usr/local/lsws/lsphp74/tmp/grpc -I/usr/local/lsws/lsphp74/tmp/pear-build-rootAUVQbV/grpc-1.53.0/include -I/usr/local/lsws/lsphp74/tmp/pear-build-rootAUVQbV/grpc-1.53.0/main -I/usr/local/lsws/lsphp74/tmp/grpc -I/usr/local/lsws/lsphp81/include/php -I/usr/local/lsws/lsphp81/include/php/main -I/usr/local/lsws/lsphp81/include/php/TSRM -I/usr/local/lsws/lsphp81/include/php/Zend -I/usr/local/lsws/lsphp81/include/php/ext -I/usr/local/lsws/lsphp81/include/php/ext/date/lib -I/usr/local/lsws/lsphp74/tmp/grpc/include -I/usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/upb-generated -I/usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/upbdefs-generated -I/usr/local/lsws/lsphp74/tmp/grpc/src/php/ext/grpc -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/abseil-cpp -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/address_sorting/include -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/boringssl-with-bazel/src/include -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/re2 -I/usr/local/lsws/lsphp74/tmp/grpc/third_p
arty/upb -I/usr/local/lsws/lsphp74/tmp/grpc/third_party/xxhash -DHAVE_CONFIG_H -std=c++14 -fno-exceptions -fno-rtti -g -O2 -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 -DGRPC_XDS_USER_AGENT_NAME_SUFFIX=\"PHP\" -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX=\"1.53.0\" -DZEND_COMPILE_DL_EXT=1 -c /usr/local/lsws/lsphp74/tmp/grpc/src/core/ext/filters/backend_metrics/backend_metric_filter.cc -MMD -MF src/core/ext/filters/backend_metrics/backend_metric_filter.dep -MT src/core/ext/filters/backend_metrics/backend_metric_filter.lo
g++: error: unrecognized command line option '-std=c++14'
make: *** [src/core/ext/filters/backend_metrics/backend_metric_filter.lo] Error 1
ERROR: `make' failed
[root@fastday-server bin]# 

Go to ~/.bashrc and add export PATH=$PATH:/usr/local/lsws/lsphp81/bin/pear then run source ~/.bashrc in ssh terminal

[root@fastday-server bin]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/lsws/lsphp81/bin/pear:/root/bin

The output is the same…

If it is possible can I give you my SSH access if you can help me?

[email protected]

You see here its resulting to using lsphp74 since it cannot find pear installed on lsphp81 - not in path it states. My last advice would be change default php to lsphp81 and these issues should go away

I have already changed my default PHP to 8.1.

[root@fastday-server ~]# php -v
PHP 8.1.17 (cli) (built: Mar 14 2023 19:50:20) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.17, Copyright (c) Zend Technologies

Anyway, Thank you for your help, Sir.