PHP Startup: Unable to load dynamic library '*' cannot open shared object file: Too many open files in system)

Operating System & Version
Centos 7.8
cPanel & WHM Version
11.88.0.6

Abdulrahman Hassoun

Registered
Mar 4, 2018
4
0
1
Dubai
cPanel Access Level
Root Administrator
Hello,

This problem seems to "build up" over time (7-10 days in my case) and goes away after a reboot.

It started to happen only after installing nginx (along with apache, as far as I understand from the sysadmin)

This is what I see on /var/log//apache2/error_log :

Code:
[Fri Jun 05 18:49:45.018044 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/mysqli.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/mysqli.so: cannot open shared object file: Too many open files in system), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/mysqli.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/mysqli.so.so: cannot open shared object file: Too many open files in system)) in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.018431 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_mysql.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: Too many open files in system), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_mysql.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_mysql.so.so: cannot open shared object file: Too many open files in system)) in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.018784 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_odbc.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_odbc.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_odbc.so: cannot open shared object file: Too many open files in system), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_odbc.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_odbc.so.so: cannot open shared object file: Too many open files in system)) in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.019160 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_pgsql.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_pgsql.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_pgsql.so: cannot open shared object file: Too many open files in system), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_pgsql.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_pgsql.so.so: cannot open shared object file: Too many open files in system)) in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.019509 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_sqlite.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_sqlite.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_sqlite.so: cannot open shared object file: Too many open files in system), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_sqlite.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/pdo_sqlite.so.so: cannot open shared object file: Too many open files in system)) in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.019834 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library 'wddx.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/wddx.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/wddx.so: cannot open shared object file: Too many open files in system), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/wddx.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/wddx.so.so: cannot open shared object file: Too many open files in system)) in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.020206 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library 'xmlreader.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/xmlreader.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/xmlreader.so: cannot open shared object file: Too many open files in system), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/xmlreader.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/xmlreader.so.so: cannot open shared object file: Too many open files in system)) in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.020555 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library 'xmlrpc.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/xmlrpc.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/xmlrpc.so: cannot open shared object file: Too many open files in system), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/xmlrpc.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/xmlrpc.so.so: cannot open shared object file: Too many open files in system)) in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.020630 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] AH01215: Fri Jun  5 18:49:45 2020 (49220): Fatal Error Unable to create lock file: Bad file descriptor (9): /usr/local/cpanel/cgi-sys/ea-php73, referer: https://domain/wp-admin/post-new.php?post_type=product
[Fri Jun 05 18:49:45.020643 2020] [cgi:error] [pid 5031] [client 000:000:000:000:0] End of script output before headers: ea-php73, referer:
What helpful information can I provide?
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello @Abdulrahman Hassoun

Thank you for contacting cPanel. Can you please let us know if your server uses CloudLinux? If so, please run the following command to determine if there have been any recent LVE faults:

lveinfo --by-fault=any --period=1d --display-username --limit=0 --show-all

Best regards
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello again @Abdulrahman Hassoun

Thank you for your update. The error indicates that your server's open files limit was reached. You will likely need to either increase the limit, or identify what is causing the limit to be reached. Can you please reply with the results of the following commands?

Code:
cat /etc/redhat-release
cat /usr/local/cpanel/version
ulimit -n
cat /proc/sys/fs/file-max
grep nofile /etc/security/limits.conf
grep FD /etc/sysconfig/httpd

Thank you
 

Abdulrahman Hassoun

Registered
Mar 4, 2018
4
0
1
Dubai
cPanel Access Level
Root Administrator
Sure, here we go:

Code:
[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
[[email protected] ~]# cat /usr/local/cpanel/version
11.88.0.9
[[email protected] ~]# ulimit -n
100000
[[email protected] ~]# cat /proc/sys/fs/file-max
131072
[[email protected] ~]# grep nofile /etc/security/limits.conf
#        - nofile - max number of open file descriptors
*               soft    nofile          100000
*               hard    nofile          100000
[[email protected] ~]# grep FD /etc/sysconfig/httpd
# cPanel Specific Variables to allow users to override FD limits
#MIN_FD_LIMIT=10000
#MAX_FD_LIMIT=60000
[[email protected] ~]#
I must mention that I don't receive a large number of (legitimate) traffic, almost not at all - less than 200 random visitors across all the day, across all PHP sites on the server.

Most sites are up-to-date WordPress sites
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello @Abdulrahman Hassoun

The open files limit for your server is quite high. Based on the information available, it's difficult to infer why the "Too many open files in system" is repeatedly being logged to the Apache error log. I encourage you to submit a ticket using the link in my signature so that our Technical Analysts can investigate this further.

Best regards
 

Josecarlosne

Registered
Jun 13, 2020
1
0
1
Montería
cPanel Access Level
Reseller Owner
Buenas tardes, instalé WHMCS, con el instalador de softaculous , toda la instalación se hace de manera correcta , pero no puedo acceder al log de administración , en la carpeta public_html el erro_log : PHP Warning: PHP Startup: Unable to load dynamic library '/opt/php71/lib/php/extensions/no-debug-non-zts-20160303/ixed.7.1.lin' - /opt/php71/lib/php/extensions/no-debug-non-zts-20160303/ixed.7.1.lin: cannot open shared object file: No such file or directory in Unknown on. Gracias por su ayuda
 

andrew.n

Well-Known Member
Jun 9, 2020
626
181
43
EU
cPanel Access Level
Root Administrator
you are missing SourceGuardian PHP extension but please open a new thread.