Issue with CentOS 7 and php 7.4 during oniguruma update

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,158
Hello,

We would like to make an announcement about an issue we've discovered about recent issues with PHP 7.4 on CentOS 7, requiring recompilation of PHP ("./build php n") after issuance of "yum update", even if this update was automated.

Affecting
Affecting systems with all 3 conditions:
  1. CentOS 7
  2. php 7.4 (all modes: php-fpm, cli, fastcgi)
  3. yum update of oniguruma package
Cause
The oniguruma library is no longer bundled with PHP 7.4, instead libonig needs to be available on the system (or --disable-mbregex used to disable the mbregex component). CentOS 7 epel repository, which was used for installation of oniguruma-devel by default, updated their library lately. The update swaps /usr/lib64/libonig.so.2 with /usr/lib64/libonig.so.5 and breaks the linking of the library for /usr/local/php74/sbin/php-fpm74 (and other) binary files, that results in PHP outage.

Errors
You'd see an error that might look like this:
Code:
/usr/local/bin/php: error while loading shared libraries: libonig.so.2: cannot open shared object file: No such file or directory

Solution
A simple recompile of php will do the trick:
Code:
/usr/local/directadmin/custombuild/build php n

If you run multiple versions as PHP, and you'd like to recompile just PHP-FPM 7.4 (for example) you may use the following command:
Code:
/usr/local/directadmin/custombuild/build php_expert 7.4 php-fpm

We hope the advanced warning will help mitigate the issue for anyone affected.

John
 
Today, after cron reload services or auto updates and one yum update.

This is the same problem?

Code:
server systemd: php-fpm74.service: main process exited, code=exited, status=127/n/a
server systemd: Unit php-fpm74.service entered failed state.
server systemd: php-fpm74.service failed.
server systemd: Starting The PHP FastCGI Process Manager...
server php-fpm74: /usr/local/php74/sbin/php-fpm74: error while loading shared libraries: libonig.so.2: cannot open shared object file: No such file or directory
server systemd: php-fpm74.service: main process exited, code=exited, status=127/n/a
server systemd: Failed to start The PHP FastCGI Process Manager.
server systemd: Unit php-fpm74.service entered failed state.
server systemd: php-fpm74.service failed.
 
After the
Code:
/usr/local/directadmin/custombuild/build php n

php now starts but httpd stopped :(

Code:
server httpd: AH00526: Syntax error on line 12 of /etc/httpd/conf/extra/httpd-modsecurity.conf:
server httpd: Invalid command 'SecAuditLogFormat', perhaps misspelled or defined by a module not included in the server configuration
server systemd: httpd.service: main process exited, code=exited, status=1/FAILURE
server systemd: Failed to start The Apache HTTP Server.
server systemd: Unit httpd.service entered failed state.
server systemd: httpd.service failed.
 
httpd working again

Code:
cd /usr/local/directadmin/custombuild
./build modsecurity
./build modsecurity_rules
 
How to configure php 7.3 to 7.4?
I see in CustomBuild, there are option to change its easily, look like this picture
1593603651953.png
I am using CentOs7
If i change 7.3 to 7.4 and click "save" button, there another things should i do?

Sorry, out of topic :)
Thanks you very much for help
 
Last edited:
When building php 7.4 I am getting

Code:
No package 'oniguruma' found
 
I had to install oniguruma

Code:
yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-6.9.5+rev1-2.el7.remi.x86_64.rpm
yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-devel-6.9.5+rev1-2.el7.remi.x86_64.rpm
 
In the short term I want to upgrade PHP 7.3 to version 7.4 on CentOS 7.

To avoid problems with PHP outages I assume that after a 'yum update' I have to install first the uniguruma package what @floyd says, and then the usual ./build php n ?

And are there possibilities that this process can be integrated in the Custombuild?
 
That's correct Aar.

First install oniguruma. The latest version is 6.9.5 rev 1.3:
Code:
yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-6.9.5+rev1-3.el7.remi.x86_64.rpm
yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-devel-6.9.5+rev1-3.el7.remi.x86_64.rpm

Then:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build set php1_release 7.4
./build php n
./build rewrite_confs
 
  • Like
Reactions: Aar
Back
Top