Re: [PHP] cannot allocate memory in static TLS block

It looks like you're using PHP as an Apache extension (mod_php) with the Event MPM. This is not a recommended setup.

Either switch to PHP-FPM (I would recommend this option) or use the Prefork MPM.

Using PHP-FPM will completely separate PHP and Apache, which will reduce the potential for issues (particularly if using PHP from a third party repo or self-compiled), as well as being more flexible and performant.

See the warnings on PHP: Apache 2.x on Unix systems - Manual

See also PHP - HTTPD - Apache Software Foundation

On 2024-07-16 11:35, AllenJB wrote:

It looks like you're using PHP as an Apache extension (mod_php) with the Event MPM. This is not a recommended setup.

Either switch to PHP-FPM (I would recommend this option) or use the Prefork MPM.

Using PHP-FPM will completely separate PHP and Apache, which will reduce the potential for issues (particularly if using PHP from a third party repo or self-compiled), as well as being more flexible and performant.

See the warnings on PHP: Apache 2.x on Unix systems - Manual

See also PHP - HTTPD - Apache Software Foundation

Okay,

thank you. Switching to Prefork MPM. I will read how to setup PHP-FPM under Apache.

On 2024-07-16 11:35, AllenJB wrote:

It looks like you're using PHP as an Apache extension (mod_php) with the Event MPM. This is not a recommended setup.

Either switch to PHP-FPM (I would recommend this option) or use the Prefork MPM.

Using PHP-FPM will completely separate PHP and Apache, which will reduce the potential for issues (particularly if using PHP from a third party repo or self-compiled), as well as being more flexible and performant.

See the warnings on PHP: Apache 2.x on Unix systems - Manual

See also PHP - HTTPD - Apache Software Foundation

Morning,

the problem happened even with Apache Prefork MPM.

[Fri Jul 19 08:42:44.570830 2024] [mpm_prefork:notice] [pid 25377:tid 25377] AH00173: SIGHUP received. Attempting to restart
[Fri Jul 19 08:42:46.064865 2024] [http2:warn] [pid 25377:tid 25377] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
PHP Warning: Failed loading Zend extension 'opcache' (tried: /usr/lib64/php/extensions/opcache (/usr/lib64/php/extensions/opcache: cannot open shared object file: No such file or directory), /usr/lib64/php/extensions/opcache.so (/usr/lib64/php/extensions/opcache.so: cannot allocate memory in static TLS block)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/lib64/php/extensions/intl (/usr/lib64/php/extensions/intl: cannot open shared object file: No such file or directory), /usr/lib64/php/extensions/intl.so (/usr/lib64/php/extensions/intl.so: cannot allocate memory in static TLS block)) in Unknown on line 0

I switch to NGINX with PHP-FPM but just report the problem if is interesting for PHP community.