Solved Apache24 + PHP7.1 got "No space available for static Thread Local Storage" error when start.

epopen

Active Member

Thanks: 7
Messages: 114

#1
Hi All

I have a running server (FreeBSD 11.1 i386 @ 256MB machine, apache 2.4 + PHP5.6) work fine.
Nearly, I plan upgrade to PHP7.1, but got below error message when apache24 service start.
Code:
httpd: Syntax error on line 144 of /usr/local/etc/apache24/httpd.conf:
Syntax error on line 1 of /usr/local/etc/apache24/modules.d/100_mod_php7.conf:
Cannot load libexec/apache24/libphp7.so into server: /usr/local/libexec/apache24/libphp7.so:
No space available for static Thread Local Storage
The problem occur from PHP7.0 on my server, but can't fix until now.
I google and result https://bugs.php.net/bug.php?id=71189
The bug status: Open still...

Can help me about debug, suggest or solution?
Thank a lot.
 

Snurg

Aspiring Daemon

Thanks: 326
Messages: 794

#2
Do you have any possibility to upgrade that machine? I mean, 256 MB might a bit little for todays' software.
 
OP
OP
epopen

epopen

Active Member

Thanks: 7
Messages: 114

#3
Do you have any possibility to upgrade that machine? I mean, 256 MB might a bit little for todays' software.
The machine's chipset maximum amount of memory is 256MB.
Yes, I planning take new machine, but run old one before get it.

Thanks you a lot.
 

Snurg

Aspiring Daemon

Thanks: 326
Messages: 794

#4
You might then try to tune down memory consumption.
Less buffers, processes and all that. If you walk through the .conf files you'll find some knobs and levers to do this.
A custom kernel with only the device drivers actually being used could also help save a bit of memory.
 
OP
OP
epopen

epopen

Active Member

Thanks: 7
Messages: 114

#5
You might then try to tune down memory consumption.
Less buffers, processes and all that. If you walk through the .conf files you'll find some knobs and levers to do this.
A custom kernel with only the device drivers actually being used could also help save a bit of memory.
I had been try to less resource like StartServers=1(mpm_event_module), MySQL stopped and fully minimum custom kernel running.
100MB up free RAM, but always got same problem...

Thanks you very much.
 

obsigna

Aspiring Daemon

Thanks: 431
Messages: 769

#6
Remember, once you setup Apache with one of the threaded MPM modules, you need to build all PHP stuff with the ZTS support enabled. That said, if thread local storage is the problem, you might want to use Apache 24 with the non-threaded prefork MPM, which is anyway a better choice for a low profile machine.

And, once you reenable MySQL, make sure that innodb and performance_schema are both set to = OFF in the relevant my.cnf file.
 
OP
OP
epopen

epopen

Active Member

Thanks: 7
Messages: 114

#7
Remember, once you setup Apache with one of the threaded MPM modules, you need to build all PHP stuff with the ZTS support enabled. That said, if thread local storage is the problem, you might want to use Apache 24 with the non-threaded prefork MPM, which is anyway a better choice for a low profile machine.

And, once you reenable MySQL, make sure that innodb and performance_schema are both set to = OFF in the relevant my.cnf file.
Now, Apache24 MPM mode change to MPM_PREFORK and building.
And PHP 7.1 (php-71 & mod_php71) turn off both LINKTHR (Link thread lib (for threaded extensions)) and ZTS (Force Zend Thread Safety (ZTS) build) and building.

Thanks you a lot.
 
OP
OP
epopen

epopen

Active Member

Thanks: 7
Messages: 114

#8
Hi All

Apahce MPM_PREFORK mode with
Turn off PHP 7.1 (php-71 & mod_php71) turn off both LINKTHR (Link thread lib (for threaded extensions)) and ZTS (Force Zend Thread Safety (ZTS) build)
Work !

But mod_http2 won't work because it thread support required.

Thanks every one help a lot.:)
 
Top