Properly configure PHP7.2 with PHP-FPM On?

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Hello, I used php 7.0 with DSO and PHP-FPM off
Now I have php 7.2 with PHP-FPM On, but I have a lot of errors in apache error_log: related with mod_ruid2, proxy_fcgi, permissions,....

In PHP Multiedior, I can select CGI or DSO for each domain.

I have installed these apache modules
Code:
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_prefork_module (shared)
 cgi_module (shared)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 expires_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 proxy_module (shared)
 proxy_fcgi_module (shared)
 proxy_http_module (shared)
 proxy_wstunnel_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 slotmem_shm_module (shared)
 socache_dbm_module (shared)
 socache_shmcb_module (shared)
 status_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 userdir_module (shared)
 bwlimited_module (shared)
 ssl_module (shared)
 security2_module (shared)
 ruid2_module (shared)
And this PHP Extensions
Code:
[PHP Modules]
Core
ctype
curl
date
dom
exif
filter
ftp
gd
hash
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]
My question is,
How to properly configure PHP7.2 with PHP-FPM On, and without conflicts with php handlers?

Many thanks.
 

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Hello @cPanelLauren

I have errors related with proxy_fcgi:error. In 1 second I have hundreds of this errors:

Code:
.....
[Tue Oct 09 19:57:54.513255 2018] [proxy_fcgi:error] [pid 19420] (70007)The timeout specified has expired: [client 213.27.203.187:18921] AH01075: Error dispatching request to : (polling), referer: https://www.mydomain.com/
[Tue Oct 09 19:58:16.966583 2018] [proxy_fcgi:error] [pid 19667] (70007)The timeout specified has expired: [client 94.130.70.19:43112] AH01075: Error dispatching request to : (polling)
[Tue Oct 09 20:00:01.532849 2018] [proxy_fcgi:error] [pid 19662] (70007)The timeout specified has expired: [client 94.130.70.19:43096] AH01075: Error dispatching request to : (polling)
[Tue Oct 09 20:00:01.765599 2018] [proxy_fcgi:error] [pid 19663] (70007)The timeout specified has expired: [client 94.130.70.19:43104] AH01075: Error dispatching request to : (polling)
[Tue Oct 09 20:00:08.503175 2018] [proxy_fcgi:error] [pid 19459] (70007)The timeout specified has expired: [client 213.27.203.187:21932] AH01075: Error dispatching request to : (polling), referer: https://www.mydomain.com/
[Tue Oct 09 20:00:21.478012 2018] [proxy_fcgi:error] [pid 19412] (70007)The timeout specified has expired: [client 213.27.203.187:34242] AH01075: Error dispatching request to : (polling), referer: https://www.mydomain.com/
[Tue Oct 09 20:00:21.543915 2018] [proxy_fcgi:error] [pid 19672] (70007)The timeout specified has expired: [client 94.130.70.19:43124] AH01075: Error dispatching request to : (polling)
[Tue Oct 09 20:00:21.712133 2018] [proxy_fcgi:error] [pid 19661] (70007)The timeout specified has expired: [client 94.130.70.19:43094] AH01075: Error dispatching request to : (polling)
.....
My domains stop working and I have to restart the php-fpm apache service.

After last restart I also have this errors:
Code:
[Tue Oct 09 20:22:04.891406 2018] [proxy_fcgi:error] [pid 19621] [client 217.23.7.126:55048] AH01079: failed to make connection to backend: httpd-UDS, referer: http://www.mydomain.com/
[Tue Oct 09 20:22:04.892142 2018] [proxy:error] [pid 19543] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php72/root/usr/var/run/php-fpm/5a1759add1c29057a1bf74e5fad03e9a340b8b4e.sock (*) failed
[Tue Oct 09 20:22:04.892153 2018] [proxy_fcgi:error] [pid 19543] [client 54.36.148.184:37574] AH01079: failed to make connection to backend: httpd-UDS
[Tue Oct 09 20:22:04.892164 2018] [proxy:error] [pid 19623] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php72/root/usr/var/run/php-fpm/5a1759add1c29057a1bf74e5fad03e9a340b8b4e.sock (*) failed
[Tue Oct 09 20:22:04.892173 2018] [proxy_fcgi:error] [pid 19623] [client 217.23.7.126:56210] AH01079: failed to make connection to backend: httpd-UDS, referer: http://viagranorx.com
[Tue Oct 09 20:22:04.893060 2018] [proxy:error] [pid 18814] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php72/root/usr/var/run/php-fpm/5a1759add1c29057a1bf74e5fad03e9a340b8b4e.sock (*) failed
[Tue Oct 09 20:22:04.893070 2018] [proxy_fcgi:error] [pid 18814] [client 54.36.148.232:19336] AH01079: failed to make connection to backend: httpd-UDS
[Tue Oct 09 20:22:04.893716 2018] [proxy:error] [pid 19611] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php72/root/usr/var/run/php-fpm/5a1759add1c29057a1bf74e5fad03e9a340b8b4e.sock (*) failed
[Tue Oct 09 20:22:04.893724 2018] [proxy_fcgi:error] [pid 19611] [client 217.23.7.126:59372] AH01079: failed to make connection to backend: httpd-UDS, referer: http://viagranorx.com
My PHP-FPM Pool Options are:
Max Children: 10
Process Idle Timeout: 10
Max Requests: 20

In PrevirtualHost Include (Apache Configuration) I have:
<IfModule proxy_fcgi_module>
timeout 300
ProxyTimeout 300
</IfModule>
 

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Hi @cPanelLauren, thanks for your help.

I think you mean
Code:
/opt/cpanel/ea-php72/root/usr/var/log/php-fpm/error.log
The last 50 entries are:
Code:
[09-Oct-2018 21:47:51] NOTICE: [pool mydomain_com] child 15232 exited with code 0 after 52.841813 seconds from start
[09-Oct-2018 21:47:51] NOTICE: [pool mydomain_com] child 15422 started
[09-Oct-2018 21:48:01] NOTICE: [pool mydomain_com] child 15263 exited with code 0 after 57.249727 seconds from start
[09-Oct-2018 21:48:01] NOTICE: [pool mydomain_com] child 15554 started
[09-Oct-2018 21:48:01] NOTICE: [pool mydomain_com] child 15266 exited with code 0 after 57.121839 seconds from start
[09-Oct-2018 21:48:01] NOTICE: [pool mydomain_com] child 15565 started
[09-Oct-2018 21:48:28] NOTICE: [pool mydomain_com] child 15387 exited with code 0 after 49.501462 seconds from start
[09-Oct-2018 21:48:28] NOTICE: [pool mydomain_com] child 15667 started
[09-Oct-2018 21:48:41] NOTICE: [pool mydomain_com] child 15413 exited with code 0 after 52.779644 seconds from start
[09-Oct-2018 21:48:41] NOTICE: [pool mydomain_com] child 15720 started
[09-Oct-2018 21:48:42] NOTICE: [pool mydomain_com] child 15422 exited with code 0 after 50.667894 seconds from start
[09-Oct-2018 21:48:42] NOTICE: [pool mydomain_com] child 15726 started
[09-Oct-2018 21:48:42] NOTICE: [pool mydomain_com] child 15554 exited with code 0 after 41.337354 seconds from start
[09-Oct-2018 21:48:42] NOTICE: [pool mydomain_com] child 15729 started
[09-Oct-2018 21:48:43] NOTICE: [pool mydomain_com] child 15565 exited with code 0 after 41.819954 seconds from start
[09-Oct-2018 21:48:43] NOTICE: [pool mydomain_com] child 15734 started
[09-Oct-2018 21:48:53] NOTICE: [pool mydomain_com] child 15667 exited with code 0 after 24.411783 seconds from start
[09-Oct-2018 21:48:53] NOTICE: [pool mydomain_com] child 15814 started
[09-Oct-2018 21:49:08] NOTICE: [pool mydomain_com] child 15726 exited with code 0 after 25.978435 seconds from start
[09-Oct-2018 21:49:08] NOTICE: [pool mydomain_com] child 15869 started
[09-Oct-2018 21:49:08] NOTICE: [pool mydomain_com] child 15729 exited with code 0 after 26.216149 seconds from start
[09-Oct-2018 21:49:08] NOTICE: [pool mydomain_com] child 15874 started
[09-Oct-2018 21:49:09] NOTICE: [pool mydomain_com] child 15720 exited with code 0 after 28.659017 seconds from start
[09-Oct-2018 21:49:09] NOTICE: [pool mydomain_com] child 15880 started
[09-Oct-2018 21:49:12] NOTICE: [pool mydomain_com] child 15734 exited with code 0 after 29.515747 seconds from start
[09-Oct-2018 21:49:12] NOTICE: [pool mydomain_com] child 15893 started
[09-Oct-2018 21:49:45] NOTICE: [pool mydomain_com] child 15814 exited with code 0 after 52.029793 seconds from start
[09-Oct-2018 21:49:45] NOTICE: [pool mydomain_com] child 16066 started
[09-Oct-2018 21:49:57] NOTICE: [pool mydomain_com] child 15869 exited with code 0 after 49.290116 seconds from start
[09-Oct-2018 21:49:57] NOTICE: [pool mydomain_com] child 16110 started
[09-Oct-2018 21:50:00] NOTICE: [pool mydomain_com] child 15874 exited with code 0 after 51.639232 seconds from start
[09-Oct-2018 21:50:00] NOTICE: [pool mydomain_com] child 16126 started
[09-Oct-2018 21:50:02] NOTICE: [pool mydomain_com] child 15880 exited with code 0 after 52.643549 seconds from start
[09-Oct-2018 21:50:02] NOTICE: [pool mydomain_com] child 16159 started
[09-Oct-2018 21:50:05] NOTICE: [pool mydomain_com] child 15893 exited with code 0 after 52.448264 seconds from start
[09-Oct-2018 21:50:05] NOTICE: [pool mydomain_com] child 16177 started
[09-Oct-2018 21:50:35] NOTICE: [pool mydomain_com] child 16066 exited with code 0 after 50.375507 seconds from start
[09-Oct-2018 21:50:35] NOTICE: [pool mydomain_com] child 16276 started
[09-Oct-2018 21:50:57] NOTICE: [pool mydomain_com] child 16159 exited with code 0 after 55.093492 seconds from start
[09-Oct-2018 21:50:57] NOTICE: [pool mydomain_com] child 16356 started
[09-Oct-2018 21:51:00] NOTICE: [pool mydomain_com] child 16126 exited with code 0 after 60.156346 seconds from start
[09-Oct-2018 21:51:00] NOTICE: [pool mydomain_com] child 16374 started
[09-Oct-2018 21:51:02] NOTICE: [pool mydomain_com] child 16110 exited with code 0 after 64.678960 seconds from start
[09-Oct-2018 21:51:02] NOTICE: [pool mydomain_com] child 16387 started
[09-Oct-2018 21:51:02] NOTICE: [pool mydomain_com] child 16177 exited with code 0 after 57.544942 seconds from start
[09-Oct-2018 21:51:02] NOTICE: [pool mydomain_com] child 16393 started
[09-Oct-2018 21:51:08] NOTICE: [pool mydomain1_com] child 16115 exited with code 0 after 70.375765 seconds from start
[09-Oct-2018 21:51:08] NOTICE: [pool mydomain1_com] child 16435 started
[09-Oct-2018 21:51:14] NOTICE: [pool mydomain1_com] child 16113 exited with code 0 after 75.959119 seconds from start
[09-Oct-2018 21:51:14] NOTICE: [pool mydomain1_com] child 16452 started
If I search for warnings I have:
Code:
[07-Oct-2018 11:48:40] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[07-Oct-2018 23:36:51] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[08-Oct-2018 01:19:43] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[08-Oct-2018 09:00:27] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[08-Oct-2018 10:26:12] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[08-Oct-2018 14:59:39] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[08-Oct-2018 16:32:42] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[08-Oct-2018 21:02:54] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[08-Oct-2018 22:30:40] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[09-Oct-2018 02:25:55] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[09-Oct-2018 12:31:08] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[09-Oct-2018 15:05:49] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
[09-Oct-2018 19:31:05] WARNING: [pool mydomain_com] server reached max_children setting (10), consider raising it
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
Hi @Nurs1927


That's exactly what I meant, I apologize for the confusion and my typo! So that Warning you're getting indicates you're hitting your pool limits - this could and would cause the errors you're seeing. I would suggest modifying the max_children for that pool.
 
  • Like
Reactions: Nurs1927

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Hello @cPanelLauren , How do not log "NOTICE" in /opt/cpanel/ea-php72/root/usr/var/log/php-fpm/error.log

Because I have this in Multi PHP Editor
Code:
error_reporting = E_ALL & ~E_NOTICE
But NOTICE appears in logs.
 

kdean

Well-Known Member
Oct 19, 2012
377
65
78
Orlando, FL
cPanel Access Level
Root Administrator
Go to /var/cpanel/ApachePHPFPM

Create or edit "system_pool_defaults.yaml"

and add (mine has others you may want as well):

Code:
--- 
php_admin_value[error_reporting]: E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
Then if I remember correctly execute:


/scripts/php_fpm_config --rebuild


and possibly:


/scripts/rebuildhttpdconf


Then restart Apache if not already done by previous scripts.
 
  • Like
Reactions: cPanelLauren

Nurs1927

Well-Known Member
Nov 22, 2015
93
7
58
Spain
cPanel Access Level
Root Administrator
Hello anda thanks @kdean and @cPanelLauren for your support but doesn´t work for me:

Code:
[08-Apr-2020 18:49:58] NOTICE: [pool mywebsite] child 10009 exited with code 0 after 7674.418452 seconds from start
[08-Apr-2020 18:49:58] NOTICE: [pool mywebsite] child 30923 started
Modify "system_pool_defaults.yaml" doesn´t work.

Add "E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED" in WHM in MultiPHP editor doesn't work either:

Code:
;   E_ALL (Show all errors, warnings and notices including coding standards.)
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices)
;   E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
@Nurs1927
This has to be set somewhere on the server, if the global settings doesn't change it you may want to look at local settings. That documentation goes over how to update/change the INI directives per user as well.