PHP thread-safe config...

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
laserbeamninja
Forum Newbie
Posts: 12
Joined: Mon Apr 18, 2005 3:58 pm

PHP thread-safe config...

Post by laserbeamninja »

Hi Ya'll...

trying to build PHP5 for a somewhat unusual configuration...

Apache 2 / SSL
thread-safe mode
Mac OS 10.4

Using this configure command


% ./configure \
% --prefix=/sw/etc/apache2/php \
% --with-zlib \
% --with-xml \
% --with-ldap=/usr \
% --enable-cli \
% --with-zlib-dir=/usr \
% --enable-exif \
% --enable-mbstring \
% --enable-mbregex \
% --enable-dbx \
% --enable-sockets \
% --with-iodbc=/usr \
% --with-curl=/usr \
% --with-mysql=/usr/local/mysql \
% --with-apxs2=/sw/sbin/apxs \
% --enable-roxen-zts \
% --enable-safe-mode \
% --enable-thread-safty \
% --with-ssl=/sw/etc/ssl \
% --enable-ssl=/sw/etc/ssl
% sudo make
% sudo make install


% sudo apache sslstart

I get this error when I start apache:

Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
Pre-configuration failed

Primarily I am trying to get thread-safety installed correctly.

Anyone see what I'm doing wrong?

Thanks,
Christopher
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

PHP doesn't do multithreading.
laserbeamninja
Forum Newbie
Posts: 12
Joined: Mon Apr 18, 2005 3:58 pm

Post by laserbeamninja »

Is that true though?

Look, I am not a PHP expert, but it seems to me I've read several articles today only whilst I've been attempting this, and there is a libthread something that I've been building in to PHP and as I said Apache directly references it in the error above so, it would seem to me to be untrue.

Can anyone give me some more information about this?

Thanks,
Christopher
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

laserbeamninja
Forum Newbie
Posts: 12
Joined: Mon Apr 18, 2005 3:58 pm

Post by laserbeamninja »

Okay thanks.

I am put in a perdicament then. Is it possible to run multiple instances of apache on separate ports... For instance, both apache 2, one w/ threading enabled and one w/out?

I appreciate any help w/ this.

Thanks,
Christopher
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Yes, it can be done. Although you may want to look into using CGI.
laserbeamninja
Forum Newbie
Posts: 12
Joined: Mon Apr 18, 2005 3:58 pm

Post by laserbeamninja »

For my purposes, I need the threaded apache running for reasons unrelated to php and html. Do you mean I should use php in CGI mode, or are you saying switch from php altogether. The php is used on a site we're redesigning, and we'd like not to switch systems on them. I think I could suffice with an instance of apache running in forked mode just to test php specifically.

Thanks,
Chris
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm talking of PHP-CGI.
laserbeamninja
Forum Newbie
Posts: 12
Joined: Mon Apr 18, 2005 3:58 pm

Post by laserbeamninja »

Cool I am looking into that. I am tempted to go the other way, because it seems like it might be easier, but maybe not. If I understand correctly, using PHP as a CGI will allow PHP5 to run on apache, even though I am using the threaded MPM and most of the PHP libraries are not thread-safe, thus crippling PHP. Do I comprehend u proper?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Unless CGI interactions have changed in the last six or so years (on the base level) running under CGI, PHP would be a separate process for every request instance. So yes, you should be able to run PHP 5 with a multithreaded MPM under Apache.
laserbeamninja
Forum Newbie
Posts: 12
Joined: Mon Apr 18, 2005 3:58 pm

Post by laserbeamninja »

okay thank you for enlightening me. yes i am uninformed in this arena. but seriously thanks for your help, because i am figuring this out slowly but surely.
Post Reply