0

I am new to php-fpm

We are using PHP with Apache 2.4. After switching from php7_module to proxy_fcgi_module the gd extension is not found anymore. How can I make sure that it is used?

Problem for Kanboard

The error message goes like Internal Error: This PHP extension is required: "gd".

Some Versions and Configurations

  • OS: CentOS 7 (I know, we want to upgrade this year :) )

Packages

sudo yum list installed | grep php
php.x86_64                              7.2.29-1.el7.remi           @remi-php72 
php-cli.x86_64                          7.2.29-1.el7.remi           @remi-php72 
php-common.x86_64                       7.2.29-1.el7.remi           @remi-php72 
php-gd.x86_64                           7.2.29-1.el7.remi           @remi-php72 
php-json.x86_64                         7.2.29-1.el7.remi           @remi-php72 
php72-php-common.x86_64                 7.2.34-10.el7.remi          @remi-safe  
php72-php-fpm.x86_64                    7.2.34-10.el7.remi          @remi-safe  
php72-php-json.x86_64                   7.2.34-10.el7.remi          @remi-safe  
php72-php-mysqlnd.x86_64                7.2.34-10.el7.remi          @remi-safe  
php72-php-pdo.x86_64                    7.2.34-10.el7.remi          @remi-safe
# ...
php -i
phpinfo()
PHP Version => 7.2.29

System => Linux # ...
Build Date => Mar 17 2020 11:36:09
Loaded Configuration File => /etc/php.ini
Additional .ini files parsed => /etc/php.d/10-opcache.ini,
/etc/php.d/20-bz2.ini,
# ...
/etc/php.d/20-gd.ini,

Config Files

$ find / -name "php\.ini" -type f 
# /etc/opt/remi/php72/php.ini
# /etc/php.ini

$ find / -name "www\.conf" -type f 
/etc/opt/remi/php72/php-fpm.d/www.conf

$ cat /usr/lib/systemd/system/php72-php-fpm.service
# It's not recommended to modify this file in-place, because it
# will be overwritten during upgrades.  If you want to customize,
# the best way is to use the "systemctl edit" command.

[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target

[Service]
Type=notify
EnvironmentFile=/etc/opt/remi/php72/sysconfig/php-fpm
ExecStart=/opt/remi/php72/root/usr/sbin/php-fpm --nodaemonize
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

# GD ini:
$ cat /etc/php.d/20-gd.ini 
; Enable gd extension module
extension=gd

As far as I can understand this, we have all needed packages, PHP actually uses PD-extension, but php-fpm does not. There are also two different php.ini files. How can I fix this? Do I need to install a different version of php-fpm?

Finally: is it possible having two PHP installations running at all?

BairDev
  • 2,865
  • 4
  • 27
  • 50
  • 1
    You have 2 PHP version installed: `7.2.29` has the `GD` module but `7.2.34` doesn't and it looks like php-fpm is running `7.2.34`. So either use php-fpm for the previous version or install php-gd for `7.2.34`. E.g. `sudo yum install php72-php-gd` – Andrea Olivato Apr 08 '22 at 12:24
  • 1
    That's a fairly old install of PHP ([7.2 went EOL 16 months ago](https://www.php.net/eol.php)). Remi prefers the `php*` syntax to the Debian `phpx.x*` stuff for the reasons you outlined: you now have two PHP installs. You'll have to figure out which is running and install the GD library for that version – Machavity Apr 08 '22 at 12:27
  • @AndreaOlivato thanks! Two times php-common, I should have noticed that. Installing all missed extensions did help and it is terrible having two (that close) versions, but we need to do a larger clean-up anyway. – BairDev Apr 08 '22 at 12:46
  • Usual confusion between php-* and php72-php-*, see https://blog.remirepo.net/pages/English-FAQ#scl – Remi Collet Apr 08 '22 at 13:40
  • For a proper configuration, simply follow the wizard instructions, see https://rpms.remirepo.net/wizard/ – Remi Collet Apr 08 '22 at 13:41

0 Answers0