php56+mod_ruid2 -> php71+php_fpm: Broken images Wordpress / MySQL-error phpbb forums

BBM

Verified User
Joined
Jun 8, 2013
Messages
416
Location
Dutch Mountains
php56+mod_ruid2 -> php71+php_fpm: Broken images Wordpress / MySQL-error phpbb forums

Current setup:
- php1 : php56 w/mod_ruid2
- php2 : None

CentOS 6. Everything updated (yum/CB)

Tried to change to php56+php_fpm last night, from running php56+mod_php w/ mod_ruid2, and running the 2nd php-release with php71+php-fpm.
- php1 : php56+php-fpm
- php2 : php71+php-fpm
- turned off mod-ruid2 in CB

As a result, phpBB-forums got broken with a mysql-error (mysql-connect function does not exist).
And Wordpress-sites lost all of their selfhosted images.

I used: "./build php n" and rewrite configs.
Also, as a result, CSF/lfd started send out warnings of exceeded memory resources.

For the mysql-errors, should MySQL also have been Build?


Tried rebuilding php back just v71 and mod_php+mod_ruid2, but still got similar issues, so I reverted back again to the single php-setup with php56+mod_ruid2.

The affected/tested Wordpress sites/plugins and phpBB-forums were all up to date.
Will now dive into the logs to see if I can spot any errors.

Any tips/ideas?
 
Ok, just noticed the phpBB-forum mysql-errors should/could be solved with changing mysql to mysqli in the config.
https://www.phpbb.com/community/viewtopic.php?t=2401846&p=14609701

I had done some searching before updating but these kinda simple stupid things never show upfront, only after you encounter the issues...
(Would also have been 'cool' if phpBB had a simple built-in check on which php-versions it was running, and change/advice the single word in the config-file.)
 
Last edited:
After the failed PHP update-attempt a few days earlier, where I've since switched back again to the setup I was running in the first place, I'm now getting apache-errors which didn't show up before:

Code:
[Wed Jul 19 21:58:04.781501 2017] [core:notice] [pid 12360] AH00052: child pid 4002 exit signal Segmentation fault (11)
zend_mm_heap corrupted
zend_mm_heap corrupted
zend_mm_heap corrupted
[Wed Jul 19 22:01:39.270109 2017] [core:notice] [pid 12360] AH00052: child pid 3995 exit signal Segmentation fault (11)
[Wed Jul 19 22:02:11.320917 2017] [core:notice] [pid 12360] AH00052: child pid 3971 exit signal Segmentation fault (11)

Code:
[root@server bin]# /usr/local/bin/php -v
PHP 5.6.31 (cli) (built: Jul 17 2017 01:50:25) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Current CB options
Code:
[root@server custombuild]# more options.conf
#PHP Settings
php1_release=5.6
php1_mode=mod_php
php2_release=no
php2_mode=php-fpm
opcache=yes
htscanner=no
php_ini=no
php_timezone=Europe/Amsterdam
php_ini_type=production
ioncube=no
zend=no
suhosin=no
x_mail_header=yes

#MySQL Settings
mysql=5.6
mariadb=10.1
mysql_inst=mysql
mysql_backup=yes
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups
mysql_force_compile=no

#WEB Server Settings
webserver=apache
litespeed_serialno=trial
modsecurity=no
modsecurity_ruleset=comodo
apache_ver=2.4
apache_mpm=auto
mod_ruid2=yes
userdir_access=no
harden_symlinks_patch=yes
use_hostname_for_alias=no


I've only built PHP (up and downgraded again), but should I also build Apache again to get rid of the errors perhaps?
 
Last edited:
Yes, I would also recompile Apache. Remember that when you changed to php-fpm, then apache is using mpm event instead of prefork, and now when you are back to mod_php then apache should use mpm prefork instead. Because of all that, I think both need to recompile apache and rewrite confs, I would do all this (assuming that you already changed all needed settings in options.conf):

Code:
./build php n
./build rewrite_confs
./build apache
./build mod_ruid2
 
Yes before the update I only changed the php-releases and turned off mod_ruid.
When issues started appearing on phpBB and Wordpress sites I reverted back to my old CB-settings like posted above.

I'm currently building PHP as we speak, and will rebuild Apache and mod_ruid2 as well after that.
I always thought Rewrite_configs should be done after everything has been rebuilt?

Although I would want to upgrade to PHP7 in due time because of its performance upgrades (and keep PHP56 as a fallback), I still need to find out why all the images didn't show anymore on Wordpress sites.
 
I am sorry, I think you are right about rewrite_confs should be done after recompiling the others. Also I might be wrong about apache, it might not be needed to recompile apache. When I look at this guide: https://help.directadmin.com/item.php?id=459

Then it does not say anything about recompiling apache, only php and doing rewrite_confs. Sorry about my previous answer. However, hopefully your problem is solved after doing rewrite_confs.
 
Yes, but BBM reverted to use mod_php with mod_ruid2, he is no longer using php-fpm :)
 
I've updated FAQ. mod_ruid2 should work fine with PHP-FPM (changes for that were applied about 4 months ago). mysql_connect() won't work with PHP7, because MySQL extension has been removed from PHP7. MySQLi or PDO-MySQL needs to be used instead of it.
 
Rebuilt PHP, Apache and mod_ruid2 and then did Rewrite-configs and everything seems to work fine again.
Tried Rewriting configs between php and apache but got an bash-error of some kind.
Checked apache but it was still running.
Then proceeded to rebuild Apache, modruid and rewrite-configs again.

No more Zend-mm-heap errors anymore.


edit:
I've read about a few others here which mixed Mod_ruid2 with PHP-FPM without issues, but I wasn't feeling lucky enough to give that a try myself too.

I like to retain mod_ruid2 as well and will probably try another upgrade to a dual setup with PHP7.1 + 5.6 this weekend orso again.
 
Last edited:
I spoke too soon.
No more Zend heap-errors, but about 250+ of segmentation errors in today's log.
Some about every minute, but also batches of multiple per second;

Code:
[Thu Jul 20 08:21:25.901138 2017] [core:notice] [pid 10242] AH00052: child pid 29494 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.901209 2017] [core:notice] [pid 10242] AH00052: child pid 708 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.901232 2017] [core:notice] [pid 10242] AH00052: child pid 3568 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.901254 2017] [core:notice] [pid 10242] AH00052: child pid 8044 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.901275 2017] [core:notice] [pid 10242] AH00052: child pid 8061 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.901296 2017] [core:notice] [pid 10242] AH00052: child pid 9593 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.901316 2017] [core:notice] [pid 10242] AH00052: child pid 14612 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.907636 2017] [core:notice] [pid 10242] AH00052: child pid 15304 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.907671 2017] [core:notice] [pid 10242] AH00052: child pid 15319 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.907688 2017] [core:notice] [pid 10242] AH00052: child pid 15320 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.907701 2017] [core:notice] [pid 10242] AH00052: child pid 15321 exit signal Segmentation fault (11)
[Thu Jul 20 08:21:25.907713 2017] [core:notice] [pid 10242] AH00052: child pid 15322 exit signal Segmentation fault (11)
 
ON PHP 7 or PHP FPM 5.6 ?

If PHP 7x better try 5.6 to be sure/test the apllications and their plugins/addons have no problem with php 7x

OFT in logs from the sites running on the server you could see some more info about problems causing errors.

Otherwise try to use a debug / error log setting for a while

Apache Version? Did you Updated Apache also from wich version before?
Because of some kind of bug opcache whatever https://bugs.php.net/bug.php?id=65590

Did you after the updates put the value's for settings as max mem limit and that kind of stuff back to value's your server / apllications need?

Take care of this then example!


memory_limit = 1536M

If you don't specify the suffix indicating the memory allocation, it does memory allocation by default in bytes. So each process that Apache attempts to start ends up running out of memory before it can load properly hence the Seg Fault.

https://www.google.de/search?q=xit+...firefox-b&gfe_rd=cr&ei=hcZxWdH-DISV8QerzaTADQ

php-apc does not work with PHP 5.6.
 
Last edited:
ON PHP 7 or PHP FPM 5.6 ?

I went back to my original setup; php56 (mod_php)

Apache Version? Did you Updated Apache also from wich version before?
Because of some kind of bug opcache whatever https://bugs.php.net/bug.php?id=65590

Latest version 2.4.27.
I did update apache from 2.4.25 to 2.4.27 just before I tried to update php56 (mod) to php7+php-fpm.
But I didn't check the logs for any errors right after the apache update.
There could be a small chance the apache update to .27 spawned the errors later on, but I'm doubtful about that.

Did you after the updates put the value's for settings as max mem limit and that kind of stuff back to value's your server / apllications need?
No, I didn't change any php settings after I downgraded it back to 56 (mod_php) again.

"memory_limit = 128M"
 
Last edited:
I went back to my original setup; php56 (mod_php)

So solved with that?

I tried to say with my post that not every aplication or plugin or adon is running well on php7x, so if you did get that errors on that version it could be due apllications not ready for that,k or not ready for fpm default settings ( path, cache temps) and so on
 
So solved with that?

No, and that's the reason for this topic.
I'm now seeing errors/notices I didn't have before (when on the same php56, but apache 2.4.25).
Maybe it might still be apache 2.4.27 related, but I'm not handy enough to find out quickly how and why.

--

In the mean time I've turned on the 2nd php_release to php7.1 + php-fpm.
And now I'm switching sites to the 2nd release one-by-one.

At the moment there's only one site with a phpBB-forum that I can't run on php71 it seems.
I need to dig in a bit further but this might be related to phpBB extensions installed on the forum.
A different site with a phpBB-forum with the same version nr. (3.2) has no problems running on php71.

In time I want to phase out php56 alltogether so the errors 'should be' gone as well then I suspect.
 
At the moment there's only one site with a phpBB-forum that I can't run on php71 it seems.
I need to dig in a bit further but this might be related to phpBB extensions installed on the forum.
A different site with a phpBB-forum with the same version nr. (3.2) has no problems running on php71.

Could also be cause other differences like htaccess settings and so on. ( extensions / adons installed not in same use or in practice used same way and so on )
 
[cut]
At the moment there's only one site with a phpBB-forum that I can't run on php71 it seems.
I need to dig in a bit further but this might be related to phpBB extensions installed on the forum.
A different site with a phpBB-forum with the same version nr. (3.2) has no problems running on php71.

Does the extension use ioncube loaders? If so, remember that ioncube has not yet released loaders for php 7.1.x. Currently php 7.0.x is the newest that support ioncube.
 
Thanks for that info. I wouldn't know yet.
I will turn off all extentions and see if the forum will run under php71, then activate the extentions one by one.
 
Back
Top