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
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.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.