Jump to content

Thread-Safe PHP from Source


Recommended Posts

So I'm trying to learn to install stuff from source rather than binaries.  I installed Apache successfully and moved on to PHP.  Whenever I try to try /usr/local/apache2/bin/apachectl stop or start, I get:

 

[sat May 12 15:08:27.269134 2012] [so:warn] [pid 31017:tid 140056791607072] AH01574: module php5_module is already loaded, skipping
[sat May 12 15:08:27.269406 2012] [:crit] [pid 31017:tid 140056791607072] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.
AH00013: Pre-configuration failed

 

I've done some reading on 'threadsafe' php.  Seems that people recommend non-threadsafe.  Also, I'm wondering about how Apache is running a threaded MPM.  My apache config.nice looks like:

./configure --enable-so

so I would assume it would default to non-threaded MPM.

 

My PHP config looks like:

'./configure' \
'--prefix=/usr/local/apache2/php' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-config-file-path=/usr/local/apache2/php' \
'--with-mysql' \
"$@"

 

I'm also trying to make it with only what I need.  At this point in time, I'm fine with non-threaded, though I think threaded would be better in the future.

 

Currently it's localhost only, but after I learn a bit I wish to start using my configs for development.

Link to comment
https://forums.phpfreaks.com/topic/262462-thread-safe-php-from-source/
Share on other sites

If Apache is running PHP as an Apache Module, php must be built as the thread-safe flavor (one copy of php is running multiple concurrent threads.) If Apache is running php as a CGI application, php needs to be built as the non-thread-safe flavor (a separate copy of php is running for each concurrent thread.)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.