Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USE flag hell: PHP Perl and Apache with threads
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
trooper_ryan
n00b
n00b


Joined: 07 Apr 2004
Posts: 74

PostPosted: Fri Sep 30, 2011 12:54 am    Post subject: USE flag hell: PHP Perl and Apache with threads Reply with quote

I'm running a bunch of perl based web apps under apache, and mod_perl requires apache to be compiled with -threads

I'm also runnning mediawiki (which uses PHP). PHP requires Apache to be compiled with +threads.

Any suggestions to help me solve this?

Cheers
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1141
Location: Romania

PostPosted: Fri Sep 30, 2011 4:16 am    Post subject: Reply with quote

Remerge perl with ithreads flag on.
Back to top
View user's profile Send private message
trooper_ryan
n00b
n00b


Joined: 07 Apr 2004
Posts: 74

PostPosted: Wed Oct 05, 2011 4:34 am    Post subject: Reply with quote

I've googled for info on the ithreads USE flag and didnt find anything recent. And the older stuff was a mix of people saying 'dont use it'.
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Wed Oct 05, 2011 11:43 am    Post subject: Reply with quote

Hello,

I suggest having a look in USE documentation, especially the chapter named "Declaring USE flags for individual packages".

As a common rule, I'm setting USE in /etc/make.conf for system wide flags (CPU, graphical environment, ...) and everything specific to a particular package in /etc/portage/package.use.

Bye
Back to top
View user's profile Send private message
trooper_ryan
n00b
n00b


Joined: 07 Apr 2004
Posts: 74

PostPosted: Thu Oct 06, 2011 6:25 am    Post subject: Reply with quote

destroyedlolo wrote:
Hello,

I suggest having a look in USE documentation, especially the chapter named "Declaring USE flags for individual packages".

As a common rule, I'm setting USE in /etc/make.conf for system wide flags (CPU, graphical environment, ...) and everything specific to a particular package in /etc/portage/package.use.

Bye


I know how to use USE flags, it's this ithreads flag that is an unknown quantity to me. Cheers anyway.
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Thu Oct 06, 2011 7:16 am    Post subject: Reply with quote

trooper_ryan wrote:
I've googled for info on the ithreads USE flag and didnt find anything recent. And the older stuff was a mix of people saying 'dont use it'.

"ithreads" are perl threads whereas "threads" are usually posix threads. The don't use it probably refers to ithreads were bugged in the beginning (and still might be), heavy weight and being hard to use generally. However if an perl app needs ithreads because the developer decided to, you need a perl installation supporting ithreads.


Now for the problem at hand.

php has a dependency on
Code:
apache2? ( www-servers/apache[threads=] )
This means if you have built apache with threads php requires threads and if you have built apache without threads php must not be built with threads.

mod_perl depends on
Code:
|| (
        www-servers/apache[-threads]
        dev-lang/perl[ithreads]
)
This means either apache without threads or perl with ithreads is needed.

So it's either disable threads for apache and php or enable threads for apache and php and ithreads for perl.
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Thu Oct 06, 2011 9:04 am    Post subject: Reply with quote

Hum, sorry, I missed the point of the original question :(

Anyway, it should be interesting to understand why PHP is requiring threaded Apache : I did lof of build of Apache/PHP on my NetBSD's sparc boxes. On those boxes threads are totally unstable so Apache was compiled w/o threading support and everything is working well.

Alternatively, another solution should be to compile or PERL, or PHP as CGI and not as Apache mobule (so threading support will depend only on the language compiled as module, not the other).
The obvious drawback is some performances impacts, due to the forking ...
Back to top
View user's profile Send private message
Arkhelion
Apprentice
Apprentice


Joined: 07 Sep 2010
Posts: 151
Location: France

PostPosted: Tue Apr 17, 2012 1:45 pm    Post subject: Reply with quote

destroyedlolo wrote:
Hum, sorry, I missed the point of the original question :(

Anyway, it should be interesting to understand why PHP is requiring threaded Apache : I did lof of build of Apache/PHP on my NetBSD's sparc boxes. On those boxes threads are totally unstable so Apache was compiled w/o threading support and everything is working well.

Alternatively, another solution should be to compile or PERL, or PHP as CGI and not as Apache mobule (so threading support will depend only on the language compiled as module, not the other).
The obvious drawback is some performances impacts, due to the forking ...

PHP does not require a threaded apache build. The line in the ebuild means the PHP "threads" USE flag needs to be the same as the apache "threads" USE flag:
Threaded PHP needs a threaded apche build
Unthreaded PHP needs an unthreaded apache build.

PHP just ask to be of the same nature of the apache build.

As of mod_perl, it's quite the same. If you have threaded apache, you'll build a threaded mod_perl, so you need ithreads in perl. But if you have an unthreaded perl, you need to have an unthreaded apache and it'll build an unthreaded mod_perl.

These dependencies are all about consistency.
_________________
Arkhelion
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Apr 17, 2012 6:18 pm    Post subject: Reply with quote

Any reason why you need mod_php, and can't use php-fpm?
Back to top
View user's profile Send private message
Arkhelion
Apprentice
Apprentice


Joined: 07 Sep 2010
Posts: 151
Location: France

PostPosted: Wed Apr 18, 2012 12:23 pm    Post subject: Reply with quote

The OT is about mod_perl, I think, not mod_php.

May I add that I think that php-fpm is not the best use case in every situation (after all it's still CGI). And if you happen to find any complete benchmark (perf, security, load) of php-fpm VS mpm-itk I'd love to see that.
_________________
Arkhelion
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Wed Apr 18, 2012 1:24 pm    Post subject: Reply with quote

php-fpm is FastCGI, not CGI. They are completely different things.
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Mon Dec 24, 2012 2:29 pm    Post subject: Reply with quote

why not just remove "thread" use keyword from /etc/portage/package.use as soon as PHP mod in threaded mode could possibly result in apache unexpected behavior in case of using php libraries which are not implemented with taking a look at thread-safe mechanism.
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum