MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: xamer on 2016-07-01, 18:27:09

Title: php-fpm problem
Post by: xamer on 2016-07-01, 18:27:09
the problem was in all last kloxoMR7 from Kloxo-MR 7.0.0.b-2016062202 to Kloxo-MR 7.0.0.b-2016063002.

Something happens to php-fpm and needed manual restart with sh /script/restart-php-fpm
It happens when I create new domain, changing owner user or just visiting Webserver Config page without any action there.
I investigate that problem is that php can't use any class in php scripts of all of my sites. It gives 500 error at the page of the web browser.
I create simple script to test:
Code: [Select]
$m = new Memcache;
if ($m->pconnect('127.0.0.1', 11211)) { echo 'memcached'; } else { echo 'none'; }
when i hit this script everithing is fine, it gives me "memcached".
Then I visit the Webserver Config page in control Panel and in several seconds it gives 500 internal server error at the testing php script(Fatal error: Class 'Memcache' not found in...). I restart with sh /script/restart-php-fpm and everything is fine again. I notice that Kloxo CP always works fine at that problem moments. It touches only clients sites.

Can someone help me to solve this problem?

I use PHP Branch  php5.3.29, Nginx+php-fpm.
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-01, 18:50:40
Try using 'php53m' or 'php54m' in 'php used'.
Title: Re: php-fpm problem
Post by: xamer on 2016-07-01, 19:07:59
php used is empty. Should i install 'Multiple PHP Install' them and choose?
 I use PHP Used -> --PHP Branch --
And PHP Branch -> php53u_(as_5.3.29)
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-01, 20:05:11
Yes, need installed all phpm. Better change back 'php branch' to 'php54'.
Title: Re: php-fpm problem
Post by: xamer on 2016-07-01, 20:42:53
I have php branch -> php53u_(as_5.3.29) and PHP Used -> --PHP Branch -- from the beginning, because this configuration works fine in another VPS, and it is Kloxo-MR 7.0.0.b-2015121102 there. I'm afraid to change good configuration/

I install all phpm. PHP Used -> php54m and PHP Branch - > php5.4.45 and now this 500 error always there. Restart doesn't help. While restart there is error:"Starting php53m-fpm (Multiple Php): [01-Jul-2016 21:59:28] ERROR: An another FPM instance seems to already listen on /opt/configs/php-fpm/sock/php53m-apache.sock
[01-Jul-2016 21:59:28] ERROR: FPM initialization failed"
Fatal error: Class 'Memcache' not found in...
Title: Re: php-fpm problem
Post by: xamer on 2016-07-01, 21:23:56
Now nothing helps to start site, always 500 error any PHP Used or PHP Branch.

P.s. Is ot possible to install earlier version, such as Kloxo-MR 7.0.0.b-2015121102 or kloxomr7-7.0.0.b-2015011402.mr?
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-02, 00:04:29
Try 'pkill -9 php-fpm; sh /script/restart-all -y'. Yes, sometimes, change php branch will be 'An another FPM instance seems to already listen...'.
Title: Re: php-fpm problem
Post by: xamer on 2016-07-02, 00:31:37
I installed Kloxo again.
It is problem with 5.3.29, 5.4.45 works good, but i need 5.3, becouse it is an old forum that generates many errors.

Also I tried php_5.3.3 and it gives the same as 5.3.29 result with 500 error, that doesn't find classes. If I don't do anything in kloxo cp panel site goes right, but at 6 o'clock in the morning it goes wrong . Probably kloxo does some  background work, and i have to restart php-fpm.

Is there any solution to make php5.3 to work?
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-02, 04:14:15
Use 'php53m' instead 'php branch' of 'php 5.3.29' in 'php used'.

Inform here the error message when using php other then 5.3.
Title: Re: php-fpm problem
Post by: xamer on 2016-07-02, 09:19:24
I tried any php version as php branch, it didn't help. And i had to reinstall Kloxo MR

When site goes wrongwith php5.3, php error log says
PHP Warning:  PHP Startup: bcmath: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
[02-Jul-2016 03:57:55] PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php54s/usr/lib/php/modules/curl.so' - /opt/php54s/usr/lib/php/modules/curl.so: undefined symbol: php_output_write in Unknown on line 0
and etc with all dynamic libraries

I restart php-fpm and everything goes right until next morning or visiting Webserver Config page and then that kind of errors appears.
That's very interesting why))

php2.17 couldn't install, previous version of php stays installed anyway.
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-02, 10:35:32
As I said before, don't change 'php branch' (from php 5.4 to other) but choose 'phpXYm' (change XY to version number) in 'php used'.

Change php version in 'php branch' lower than 5.4 may make trouble.
Title: Re: php-fpm problem
Post by: xamer on 2016-07-03, 11:07:25
When site runs well php loads libs from extension_dir=/usr/lib64/php/modules, but when it goes wrong, for example, I visit Webserver Config page, php tries to load libs from /opt/php54s/usr/lib/php/modules and cause the problem.
After php-fpm reastart php loads libs from /usr/lib64/php/modules and sites goes well.
As it wrote earlier this problem also appears after creating new domain, changing user owner.
Is it ok?
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-03, 14:53:28
I didn't found this issue in my servers. Use latest version of Kloxo-MR 7.0.
Title: Re: php-fpm problem
Post by: xamer on 2016-07-03, 18:21:40
I use Kloxo-MR 7.0.0.b-2016070204

I found out this issue from Kloxo-MR 7.0.0.b-2016062202. Also I install several times fresh KloxoMR from 22.06.2016.
Now I add cron task restarting php-fpm every hour, but I hope there is a solution to fix this issue
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-03, 18:38:26
Update to 20160304. Change php.ini for php-fpm for related to disable_functions issue.
Title: Re: php-fpm problem
Post by: xamer on 2016-07-03, 19:25:19
I updated kloxoMR, but i didn't understand what you mean  "Change php.ini for php-fpm for related to disable_functions issue." The problem is with extension_dir= not with disable_functions.
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-03, 20:06:46
Again, I didn't found extension_dir issue in latest upload. If using custom file, adjustment this custom file with latest original template.
Title: Re: php-fpm problem
Post by: xamer on 2016-07-03, 21:55:08
I didn't use custom file, everything by default.
After installation all is well.When I visit Webserver config page, change owner, create domain error eppears and php error log says:
"[03-Jul-2016 18:28:22 Europe/London] PHP Warning:  PHP Startup: xmlrpc: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
[03-Jul-2016 18:28:22 Europe/London] PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php54s/usr/lib/php/modules/xmlwriter.so' - /opt/php54s/usr/lib/php/modules/xmlwriter.so: undefined symbol: zend_new_interned_string in Unknown on line 0
[03-Jul-2016 18:28:22 Europe/London] PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php54s/usr/lib/php/modules/xsl.so' - /opt/php54s/usr/lib/php/modules/xsl.so: undefined symbol: zend_new_interned_string in Unknown on line 0
[03-Jul-2016 18:28:22 Europe/London] PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php54s/usr/lib/php/modules/zip.so' - /opt/php54s/usr/lib/php/modules/zip.so: undefined symbol: zend_new_interned_string in Unknown on line 0" etc and site has 500 error. I restart php-fpm and all runs well.
So, there is nothing i can do.
Title: Re: php-fpm problem
Post by: MRatWork on 2016-07-03, 22:06:25
Look like issue related to change owner. I will try replication this issue.