• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question what is the easiest, full-proof way to install gRPC?

larryk

Regular Pleskian
Server operating system version
OS: CentOS Linux 7.9.2009 (Core)
Plesk version and microupdate number
Product: Plesk Obsidian 18.0.43 Update #1
OS: CentOS Linux 7.9.2009 (Core)
Product: Plesk Obsidian 18.0.43 Update #1

Hello,
Is there a push-button way to install it?
Does anyone have it installed? I was wondering if it causes any issues?

thanks!
 
I have successfully installed gRPC on the following server:
Code:
# plesk version
Product version: Plesk Obsidian 18.0.42.1
OS version: Ubuntu 20.04 x86_64
With the following steps:
Code:
# apt install gcc make plesk-php81-dev
# /opt/plesk/php/8.1/bin/pecl install grpc
# echo "extension=grpc.so" > /opt/plesk/php/8.1/etc/php.d/grpc.ini
# plesk bin php_handler --reread
Check that grpc module is loaded:
Code:
# /opt/plesk/php/8.1/bin/php -m | grep grpc
grpc

But I cant install it on CentOS server:
Code:
# plesk version   
Product version: Plesk Obsidian 18.0.44.0
OS version: CentOS 7.6.1810 x86_64

There is some gcc error in process of compiling module.
Looks like it is related to GCC version:
On CentOS server:
Code:
# gcc -v
...
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
On Ubuntu server:
Code:
# gcc -v
...
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
 
So I'm assuming, this is not going to work for my plesk server
You can try upgrading to a higher version of GCC. But this is a task for the Linux administrator and is not related to Plesk. I haven't tried it but you can try and share results here.
 
Hello,

I have successfully installed grpc on CentOS 7 Plesk 18 for PHP 8.2, we just have to use compatible GCC devtools using SCL.

Bash:
# plesk version
Product version: Plesk Obsidian 18.0.49.2
     OS version: CentOS 7.6.1810 x86_64
     Build date: 2023/01/10 16:00

Bash:
# sudo yum install centos-release-scl
# sudo yum install devtoolset-9-gcc*
# scl enable devtoolset-9 bash

Bash:
# gcc -v
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)

Bash:
# yum install make plesk-php82-devel
# /opt/plesk/php/8.2/bin/pecl install grpc
# echo "extension=grpc.so" > /opt/plesk/php/8.2/etc/php.d/grpc.ini
# plesk bin php_handler --reread

Bash:
# /opt/plesk/php/8.2/bin/php -m | grep grpc
grpc
 
Hello,

I have successfully installed grpc on CentOS 7 Plesk 18 for PHP 8.2, we just have to use compatible GCC devtools using SCL.

Bash:
# plesk version
Product version: Plesk Obsidian 18.0.49.2
     OS version: CentOS 7.6.1810 x86_64
     Build date: 2023/01/10 16:00

Bash:
# sudo yum install centos-release-scl
# sudo yum install devtoolset-9-gcc*
# scl enable devtoolset-9 bash

Bash:
# gcc -v
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)

Bash:
# yum install make plesk-php82-devel
# /opt/plesk/php/8.2/bin/pecl install grpc
# echo "extension=grpc.so" > /opt/plesk/php/8.2/etc/php.d/grpc.ini
# plesk bin php_handler --reread

Bash:
# /opt/plesk/php/8.2/bin/php -m | grep grpc
grpc
Hello,

I have tried following these steps for my Plesk Obsidian Version 18.0.59 Update #2 server running on AlmaLinux 9.3 (Shamrock Pampas Cat) but am having issues. I cannot install centos-release-scl (which is obvious since this package is CentOS specific), but from what I understand gcc is built in AlmaLinux. The current version installed is
Bash:
# gcc -v
gcc version 11.4.1 20230605 (Red Hat 11.4.1-2) (GCC)

plesk-php82-devel version
Package make-1:4.3-7.el9.x86_64
Package plesk-php82-devel-8.2.18-0redhat.9.240412.1352.x86_64

I cannot install grpc because the module is not in the directory.
Bash:
 # /opt/plesk/php/8.2/bin/pecl install grpc
PHP Warning:  PHP Startup: Unable to load dynamic library 'grpc.so' (tried: /opt/plesk/php/8.2/lib64/php/modules/grpc.so
(/opt/plesk/php/8.2/lib64/php/modules/grpc.so: cannot open shared object file: No such file or directory), /opt/plesk/php/8.2/lib64/php/modules/grpc.so.so
(/opt/plesk/php/8.2/lib64/php/modules/grpc.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

So I ran this command to install it (which took an insane amount of time)
Bash:
# sudo pecl install grpc
----------------------------------------------------------------------
Libraries have been installed in:
   /tmp/pear-build-rootD4OxQL/grpc-1.62.0/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/tmp/pear-build-rootD4OxQL/install-grpc-1.62.0" install
Installing shared extensions:     /tmp/pear-build-rootD4OxQL/install-grpc-1.62.0/usr/lib64/php/modules/
running: find "/tmp/pear-build-rootD4OxQL/install-grpc-1.62.0" | xargs ls -dils
288857030      0 drwxr-xr-x. 3 root root        17 Apr 25 13:04 /tmp/pear-build-rootD4OxQL/install-grpc-1.62.0
 34011210      0 drwxr-xr-x. 3 root root        19 Apr 25 13:04 /tmp/pear-build-rootD4OxQL/install-grpc-1.62.0/usr
 51250013      0 drwxr-xr-x. 3 root root        17 Apr 25 13:04 /tmp/pear-build-rootD4OxQL/install-grpc-1.62.0/usr/lib64
 71569130      0 drwxr-xr-x. 3 root root        21 Apr 25 13:04 /tmp/pear-build-rootD4OxQL/install-grpc-1.62.0/usr/lib64/php
 86995736      0 drwxr-xr-x. 2 root root        21 Apr 25 13:04 /tmp/pear-build-rootD4OxQL/install-grpc-1.62.0/usr/lib64/php/modules
 86995737 266428 -rwxr-xr-x. 1 root root 272816600 Apr 25 13:04 /tmp/pear-build-rootD4OxQL/install-grpc-1.62.0/usr/lib64/php/modules/grpc.so
Build process completed successfully
Installing '/usr/lib64/php/modules/grpc.so'
install ok: channel://pecl.php.net/grpc-1.62.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=grpc.so" to php.ini

As you can see this installs grpc in /usr/lib64/php/modules/grpc.so and not /opt/plesk/php/8.2/lib64/php/modules/grpc.so and thus composer cannot find the extension to install the package dependencies.
Hoping someone can shed some light on how to get this working.

Thanks
 
Back
Top