View previous topic :: View next topic |
Author |
Message |
trooper_ryan n00b
Joined: 07 Apr 2004 Posts: 74
|
Posted: Fri Sep 30, 2011 12:54 am Post subject: USE flag hell: PHP Perl and Apache with threads |
|
|
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 |
|
|
sebaro Veteran
Joined: 03 Jul 2006 Posts: 1141 Location: Romania
|
Posted: Fri Sep 30, 2011 4:16 am Post subject: |
|
|
Remerge perl with ithreads flag on. |
|
Back to top |
|
|
trooper_ryan n00b
Joined: 07 Apr 2004 Posts: 74
|
Posted: Wed Oct 05, 2011 4:34 am Post subject: |
|
|
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 |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Wed Oct 05, 2011 11:43 am Post subject: |
|
|
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 |
|
|
trooper_ryan n00b
Joined: 07 Apr 2004 Posts: 74
|
Posted: Thu Oct 06, 2011 6:25 am Post subject: |
|
|
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 |
|
|
sera Retired Dev
Joined: 29 Feb 2008 Posts: 1017 Location: CET
|
Posted: Thu Oct 06, 2011 7:16 am Post subject: |
|
|
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 |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Thu Oct 06, 2011 9:04 am Post subject: |
|
|
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 |
|
|
Arkhelion Apprentice
Joined: 07 Sep 2010 Posts: 151 Location: France
|
Posted: Tue Apr 17, 2012 1:45 pm Post subject: |
|
|
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 |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Tue Apr 17, 2012 6:18 pm Post subject: |
|
|
Any reason why you need mod_php, and can't use php-fpm? |
|
Back to top |
|
|
Arkhelion Apprentice
Joined: 07 Sep 2010 Posts: 151 Location: France
|
Posted: Wed Apr 18, 2012 12:23 pm Post subject: |
|
|
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 |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Wed Apr 18, 2012 1:24 pm Post subject: |
|
|
php-fpm is FastCGI, not CGI. They are completely different things. |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
Posted: Mon Dec 24, 2012 2:29 pm Post subject: |
|
|
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 |
|
|
|