MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Bugs and Requests => Topic started by: kloxo-fan on 2015-07-10, 18:53:14

Title: Strange problem with Apache and PHP-FPM
Post by: kloxo-fan on 2015-07-10, 18:53:14
A few days ago did update on php54 to 5.4.42 and now I have a strange problem with Apache (2.2) and PHP-FPM.
The server works well, but after a few hours (1-2-3 or even more, each time is different) the web sites on my vps just stops working. Why? I have no idea. When I check running processes everything is fine, httpd is running, php-fpm is running but the web sites not works and only loading and loading with blank page or error 500 or 503 or 520 or 521 or 522 or 523, each time is different :(
The only solution is to run "sh /script/restart-all" to restart all processes or "service httpd restart" for apache but after a few hours I got this problem again. I tried "sh /script/cleanup" to fix all services but without result because after a few hours my vps again got this problem.
In fact KloxoMR works fast, the VPS is not overloaded, all processes works, but the websites don't work :(
I think it's a bug in httpd or fpm.
How to fix this?

sh /script/sysinfo:
Code: [Select]
A. Kloxo-MR: 7.0.0.b-2015070802
   - Web:
   - PHP: php54s-5.4.42-1.ius.el6 (cgi mode)
B. Plateform:
   - OS: CentOS release 6.6 (Final) x86_64
   - Hostname: vps.zaknigi.com
C. Services:
   1. MySQL: MariaDB-server-10.0.20-1.el6.x86_64
   2. PHP:
      - Branch: php54-cli-5.4.42-1.ius.el6.x86_64
      - Multiple:
        * php53m-5.3.29-1.ius.el6
        * php54m-5.4.42-1.ius.el6
        * php55m-5.5.26-1.ius.el6
      - Used: php54m
   3. Httpd: httpd-2.2.29-2.mr.el6.x86_64
      - PHP Type: php-fpm_event
   4. Lighttpd: --uninstalled--
   5. Hiawatha: --uninstalled--
   6. Nginx: --uninstalled--
   7. Cache: --uninstalled--
   8. Dns: bind-9.9.7-1.mr.el6.x86_64
   9. Qmail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64
D. Memory:
                total       used       free     shared    buffers     cached
   Mem:          2048        418       1629         67          0        234
   -/+ buffers/cache:        183       1864
   Swap:            0          0          0
E. Disk Space:
   Filesystem      Size  Used Avail Use% Mounted on
   /dev/simfs       80G  3.5G   77G   5% /
Title: Re: Strange problem with Apache and PHP-FPM
Post by: MRatWork on 2015-07-10, 19:00:28
Yes, possible something wrong with this php version. I am not investigate this issue intensively.

You can use cron for restart web in every day for example.
Title: Re: Strange problem with Apache and PHP-FPM
Post by: kloxo-fan on 2015-07-10, 19:08:47
Okay,
I'll try the old php53m at the moment I hope with this version to have no problems.
Title: Re: Strange problem with Apache and PHP-FPM
Post by: kloxo-fan on 2015-07-10, 20:35:44
Hello again,
definitely the problem is PHP-FPM.
Even with php53m I got this bug.
But when run the command "service php-fpm restart" everything is fix for a while, until it crashes again.
Code: [Select]
Stopping php53m-fpm:                                       [  OK  ]
Starting php53m-fpm:                                       [  OK  ]
Any ideas why? Can I go back to the old version of php-fpm when used php 5.4.41?

I try to use suphp instead of php-fpm but got another error:
Code: [Select]
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: Syntax error on line 63 of /etc/httpd/conf/httpd.conf: Syntax error on line 5 of /etc/httpd/conf.d/suphp.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: cannot open shared object file: No such file or directory
                                                           [FAILED]
Can you help me?
Title: Re: Strange problem with Apache and PHP-FPM
Post by: MRatWork on 2015-07-10, 20:52:00
It's possible related to cloudflare, especially for free version.
Title: Re: Strange problem with Apache and PHP-FPM
Post by: KloxoLittleFish on 2015-07-11, 13:19:20
Recommended reading for php_fpm=> http://forum.mratwork.com/kloxo-mr-technical-helps/php-fpm_event-conf/msg42863/#msg42863
Title: Re: Strange problem with Apache and PHP-FPM
Post by: MRatWork on 2015-07-11, 13:26:58
By design, if we choose event and worker (like php-fpm_event), so impossible to found 'httpd: Syntax error on line 63 of /etc/httpd/conf/httpd.conf: Syntax error on line 5 of /etc/httpd/conf.d/suphp.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: cannot open shared object file: No such file or directory' because libphp5.so only for ruid2 or itk where Kloxo-MR disable it.