[blfs-dev] PHP-5.5.10 error: 'tsrm_ls' undeclared [Was: ... #4813: SWIG 3.0.0]

Pierre Labastie pierre.labastie at neuf.fr
Sun Mar 23 11:01:58 PDT 2014

Le 23/03/2014 11:46, Pierre Labastie a écrit :
> Le 22/03/2014 23:53, Armin K. a écrit :
>> On 03/22/2014 11:34 PM, Pierre Labastie wrote:
>>> Le 22/03/2014 22:40, Armin K. a écrit :
>>>> On 03/22/2014 09:36 PM, Pierre Labastie wrote:
>>>>> No errors in the test now: when I first tried, I built with the sed, but did
>>>>> not remove the previous, non-sed, build. Now I cleaned up everything and it works.
>>>>> I make a ticket and assign it to myself. Will commit tomorrow if not tonight...
>>>>> regards
>>>>> Pierre
>>>> Here's the thing:
>>>> Default MPM in httpd-2.4.x is threaded mpm, mpm_event. You can't use
>>>> non-ZTS PHP apache module with it. The solution is to use non-threaded
>>>> MPM which is awful (prefork or something like that) or use php-fpm via
>>>> mod_proxy_fcgid or php-cgi via mod_fcgid (separate package). I, for one,
>>>> use php-fpm.
>>> Yes, I found that: '/usr/sbin/httpd -V' returns:
>>> [Sat Mar 22 23:33:07.977944 2014] [:crit] [pid 11932:tid 140408511129472]
>>> 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
>>> So the sed is not a solution...
>>> Will try php-fpm tomorrow.
>>> Pierre
>> sed is the solution, you just need to switch MPM in httpd. But you
>> really don't want to do that since it will drastically reduce
>> performance. php-fpm or php-cgi are the way to go nowadays.
> Yeah, I meant that: it is not a solution if you want to keep threaded MPM in
> httpd.
> Still have to try php-fpm.
> Pierre
Not evident, given I have never used nor configured apache or php before. And
documentation for this new feature is sparse and hard to find...

I found http://wiki.apache.org/httpd/PHP-FPM useful.
Also, the note of Robin at http://www.php.net/manual/fr/install.fpm.php
got me started

What I have found:
- For building php, suppress the --with-apxs2 switch and add --enable-fpm
--with-fpm-user=apache --with-fpm-group=apache (and see below about
I guess --with-fpm-systemd would generate a systemd unit to start php-fpm.

- php-fpm is a daemon, which should be started at boot time. An init script is
provided with the package, but is not lsb-compliant. So, if we decide to
switch to php-fpm, we'll have to write our own.

- there is also a configuration file /etc/php-fpm.conf, where at least the
location of the .pid file has to be set. Or maybe, it is better to use the
--localestatedir=/run switch.

- two modules need to be enabled in /etc/httpd/httpd.conf: mod_proxy and
mod_proxy_fcgi. A simple sed should do.

- a directive has to be added in /etc/httpd/httpd.conf. I used:
ProxyPassMatch ^/(.*\.php)$ fcgi://$1

I guess there are more clever and secure ways, but at least, this allows to
run a simple php script:
sudo su apache -s /bin/bash \
               -c 'echo "<?php phpinfo() ?>" > /srv/www/info.php'
lynx http://localhost/info.php
returns the information about php.

I plan to include all that into the php page. Maybe the httpd.conf directive
should be improved. Please tell me if anything's wrong.


More information about the blfs-dev mailing list