We are changing our Moodle from worker mpm to use event mpm and php-fpm. It seems that it is successfully running in event mode. However, it failed to run php-fpm.
httpd -V shows that it was changed to event mpm successfully.
"Server version: Apache/2.4.29 (Unix)
Server built: Dec 13 2021 15:39:43
Server's Module Magic Number: 20120211:68
Server loaded: APR 1.7.0, APR-UTIL 1.6.1
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: event"
However, when I install php-fpm and configure it. The moodle webpage displays the below error message:
"Error: database driver problem detected
The site administrator should verify server configuration
PHP has not been properly configured with the MySQLi extension for it to communicate with MySQL. Please check your php.ini file or recompile PHP."
[root@moodleXXX etc]# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process ManagerLoaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2021-12-16 00:45:26 ; 14s ago
Main PID: 2943 (php-fpm)
Status: "Processes active: 0, idle: 5, Requests: 1, slow: 0, Traffic: 0.1req/sec"
CGroup: /system.slice/php-fpm.service
├─2943 php-fpm: master process (/etc/php-fpm.conf)
├─2944 php-fpm: pool www
├─2945 php-fpm: pool www
├─2946 php-fpm: pool www
├─2947 php-fpm: pool www
└─2948 php-fpm: pool www
Dec 16 00:45:26 moodleXXX systemd[1]: Starting The PHP FastCGI Process Manager...
Dec 16 00:45:26 moodleXXX php-fpm[2943]: Failed loading /usr/lib64/php/modules/opcache.so: /usr/lib64/php/modules/opcache.so: undefined symbol: sapi_globals_id
Dec 16 00:45:26 moodleXXX php-fpm[2943]: [16-Dec-2021 00:45:26] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php-zts/modules/msgpa...
Dec 16 00:45:26 moodleXXX php-fpm[2943]: [16-Dec-2021 00:45:26] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php-zts/modules/igbin...
Dec 16 00:45:26 moodleXXX php-fpm[2943]: [16-Dec-2021 00:45:26] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php-zts/modules/memca...
Dec 16 00:45:26 moodleXXX php-fpm[2943]: [16-Dec-2021 00:45:26] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php-zts/modules/xsl.s...
Dec 16 00:45:26 moodleXXX php-fpm[2943]: [16-Dec-2021 00:45:26] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/ph...bug-zts-201
Dec 16 00:45:26 moodleXXX systemd[1]: Started The PHP FastCGI Process Manager.
I tried many times but still cannot make php-fpm works properly. It is strange that a number of *.so files such as opcache.so cannot be loaded.
There are a lot of online information about php-fpm settings with much variation, I really don't which one I should refer to. Could anyone suggest a reliable source for reference? Thank you very much.