You are not logged in.
Today I updated apache and php :
[2014-03-06 23:46] [PACMAN] upgraded apache (2.2.26-1 -> 2.4.7-1)
[2014-03-06 23:46] [PACMAN] upgraded php (5.5.9-1 -> 5.5.10-1)
[2014-03-06 23:46] [PACMAN] upgraded php-apache (5.5.9-1 -> 5.5.10-1)
[2014-03-06 23:46] [PACMAN] upgraded php-mcrypt (5.5.9-1 -> 5.5.10-1)
but I notice that apache 2.4 fails to start ( I use the new apache 2.4 configuration file ) :
journalctl -xn :
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
httpd.service: control process exited, code=exited status=1
I don't understand, I followed the wiki for the lamp installation, do you know a solution ?
Last edited by Potomac (2014-03-07 16:34:47)
Offline
I'd use mod_proxy_fcgi and php-fpm to pass files from apache to php.
http://wiki.apache.org/httpd/PHP-FPM
http://garajau.com.br/blog/2013/12/apac … roxy_fcgi/
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
I have seen these pages but it's not easy to understand,
in fact I don't understand what to do, I installed php-fpm package but after I don't know what things I must change in /etc/httpd/conf/httpd.conf,
it would be great if someone can update the wiki page about LAMP and php :
Offline
What part are you stuck on? I've just upgraded to httpd 2.4 and it was fairly straight forward to get php working with php-fpm and mod_proxy_fcgi.
One thing you might have missed is that php-fpm listens on a unix socket by default, you need to change that to a network socket in the config file before starting the php-fpm service.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
I need to know what things I must add in /etc/httpd/conf/httpd.conf after installing php-fpm,
I don't understand this part :
Edit the configuration for a vhost of your choice, and add the following line to it:
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1
what is a vhost ?
with apache 2.2 I didn't need a vhost,
Do I need to add "LoadModule php5_module modules/libphp5.so" and "Include conf/extra/php5_module.conf" in /etc/httpd/conf/httpd.conf ?
Offline
If you're not using vhosts (virtual hosts [1]) then putting the declaration at the bottom of the httpd.conf should work.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Ok I put :
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1
but I get a 503 error,
after a search in google I found that I need to edit the configuration of php-fpm, by setting the listen option :
listen = 127.0.0.1:9000
instead of :
listen = /run/php-fpm/php-fpm.sock
It works for the php files located in "/srv/http", but it doesn't work for my php files who are located in my home directory (userdir directory option in apache ), I get the error "file not found" if I click on php file,
that's why a more clear LAMP wiki page would be great for newbies who want to use apache 2.4 and php-fpm,
I notice also that phpmyadmin package doesn't work with apache 2.4 :
AH00526: Syntax error on line 7 of /etc/httpd/conf/extra/httpd-phpmyadmin.conf:
apachectl[4743]: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
Last edited by Potomac (2014-03-07 01:44:00)
Offline
I am also having quite some trouble with the Apache update... It is very unclear to me why the old way using the php-apache package no longer works. And if it no longer works, what should it be replaced by?
I have also filed a bug report about phpmyadmin: FS#39213.
Last edited by lonaowna (2014-03-07 09:50:16)
Offline
up i have the same problem ? so i retrograted all the packages to stay in previous version of apache
Offline
I made php work with vhosts including these lines in each vhost (inside Directory):
RewriteEngine On
RewriteCond /path/to/your/documentroot%{REQUEST_URI} !-s
RewriteCond /path/to/your/documentroot%{REQUEST_URI} !-l
RewriteRule ^.*$ fcgi://localhost:9000/path/to/your/documentroot/index.php [P,NC,L]
and not the ProxyPassMatch line.
But now php can't use postgresql or mysql. ¿php-fpm is not using standard php.ini file to load extensions?
Sorry, totally messed up config files. Still trying to make php work (vhosts, phpmyadmin, phppgadmin...)
Last edited by sembei (2014-03-07 12:03:19)
Offline
Now it works for me.
But I have to type http://localhost/html.php instead of http://localhost
Potomac you can try with adding another ProxyPassMatch line for the another dir.
Offline
Good morning everybody
I've got the same problem, i haven't enabled cgi (because i use may server only for tt-rss).
I have install and configure php-fpm and mod_fcgid.
But I can't start httpd daemon.
Do I need to enable cgi as it was explain in the arch wiki for lamp : Using php5 with apache2-mpm-worker and mod_fcgid ?
Offline
I am also having this issue.
But maybe it is simply php-apache that needs to be compiled with thread support?
"Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP."
"php5 with apache2-mpm-worker and mod_fcgid" is kind of a totally different configuration. The upgrade seems to break a legit configuration.
Offline
I have same problem. Apache stopped working after upgrade and I don't know how to reconfigure it to make it work again.
Offline
I have same problem. Apache stopped working after upgrade and I don't know how to reconfigure it to make it work again.
First of all, you have to replace the httpd.conf with the newer httpd.pacnew in /etc/httpd/conf/
After that, you have to install php-fpm and add the line in /etc/php/php-fpm.conf:
listen = 127.0.0.1:9000
instead of:
listen = /run/php-fpm/php-fpm.sock
Finally add the following line in /etc/httpd/conf/httpd.conf:
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/srv/http/$1
Start/Restart php-fpm and httpd daemons
Now it works for me, except phpmyadmin
Last edited by jesusignazio (2014-03-07 12:10:26)
Offline
Me to!
After installing and configuring the php-fpm package my info.php in the document root /srv/http is working again, but roundcube and phpmyadmin still failed.
Offline
Ok I put :
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1
but I get a 503 error,
after a search in google I found that I need to edit the configuration of php-fpm, by setting the listen option :
listen = 127.0.0.1:9000
instead of :
listen = /run/php-fpm/php-fpm.sock
It works for the php files located in "/srv/http", but it doesn't work for my php files who are located in my home directory (userdir directory option in apache ), I get the error "file not found" if I click on php file,
that's why a more clear LAMP wiki page would be great for newbies who want to use apache 2.4 and php-fpm,
I notice also that phpmyadmin package doesn't work with apache 2.4 :
AH00526: Syntax error on line 7 of /etc/httpd/conf/extra/httpd-phpmyadmin.conf: apachectl[4743]: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
@Protomac, thank you. Your solution very good. I have the same problem, including httpd-phpmyadmin.conf. But the phpmyadmin is not yet solved and also the userdir.
Last edited by allencch (2014-03-07 12:33:39)
Offline
If i don't add this line to http.conf
- LoadModule php5_module modules/libphp5.so
- Include conf/extra/php5_module.conf
and if remove in httpd-vhost.conf
- php_admin_value open_basedir none
it seems to work better
But all the directory appears instead of the php page.
Last edited by Bob le pirate (2014-03-07 12:42:53)
Offline
Working with phppgadmin and phpmyadmin. Had to create a virtual host for each.
Still no working with aliases.
Offline
...
Thank you for the shared hints. Really helped me It was dragging me the whole morning!
Personal spot :: https://www.smirky.net/ :: Try not to get lost!
Offline
The new configuration by default uses an event based Multi Processing Module. As long as PHP isn't compiled threadsave, you can switch to the prefork MPM, which doesn't use threads.
In your httpd.conf find the line that loads the event MPM:
LoadModule mpm_event_module modules/mod_mpm_event.so
Replace it with one that loads the prefork MPM:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
Of course you still need to load the PHP5 module (libphp5.so) and the corresponding config file somewhere.
Offline
The new configuration by default uses an event based Multi Processing Module. As long as PHP isn't compiled threadsave, you can switch to the prefork MPM, which doesn't use threads.
In your httpd.conf find the line that loads the event MPM:
LoadModule mpm_event_module modules/mod_mpm_event.so
Replace it with one that loads the prefork MPM:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
Of course you still need to load the PHP5 module (libphp5.so) and the corresponding config file somewhere.
Perfect, thank you, that solved it for me!
Offline
teh_jazzman wrote:The new configuration by default uses an event based Multi Processing Module. As long as PHP isn't compiled threadsave, you can switch to the prefork MPM, which doesn't use threads.
In your httpd.conf find the line that loads the event MPM:
LoadModule mpm_event_module modules/mod_mpm_event.so
Replace it with one that loads the prefork MPM:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
Of course you still need to load the PHP5 module (libphp5.so) and the corresponding config file somewhere.
Perfect, thank you, that solved it for me!
For me too ! Thank you !
Offline
Potomac wrote:Ok I put :
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1
but I get a 503 error,
after a search in google I found that I need to edit the configuration of php-fpm, by setting the listen option :
listen = 127.0.0.1:9000
instead of :
listen = /run/php-fpm/php-fpm.sock
It works for the php files located in "/srv/http", but it doesn't work for my php files who are located in my home directory (userdir directory option in apache ), I get the error "file not found" if I click on php file,
that's why a more clear LAMP wiki page would be great for newbies who want to use apache 2.4 and php-fpm,
I notice also that phpmyadmin package doesn't work with apache 2.4 :
AH00526: Syntax error on line 7 of /etc/httpd/conf/extra/httpd-phpmyadmin.conf: apachectl[4743]: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
@Protomac, thank you. Your solution very good. I have the same problem, including httpd-phpmyadmin.conf. But the phpmyadmin is not yet solved and also the userdir.
You should make sure /usr/share/webapps/ and /etc/webapps are included in the line of open_basedir in /etc/php/php.ini
Also remove the line with "php_admin_value open_basedir" from /etc/httpd/conf/extra/httpd-phpmyadmin.conf
Then just add in your apache conf files the following 2 lines for phpmyadmin redirection to php-fpm :
ProxyPassMatch ^/phpmyadmin/(.*\.php)$ fcgi://127.0.0.1:9000/usr/share/webapps/phpMyAdmin/$1
ProxyPassMatch ^/phpmyadmin(.*/)$ fcgi://127.0.0.1:9000/usr/share/webapps/phpMyAdmin$1index.php
My /etc/httpd/conf/extra/httpd-phpmyadmin.conf now looks like
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>
With this I can use phpmyadmin as always by going to http://myserver/phpmyadmin
Last edited by robin67 (2014-03-07 15:17:42)
Offline
The new configuration by default uses an event based Multi Processing Module. As long as PHP isn't compiled threadsave, you can switch to the prefork MPM, which doesn't use threads.
In your httpd.conf find the line that loads the event MPM:
LoadModule mpm_event_module modules/mod_mpm_event.so
Replace it with one that loads the prefork MPM:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
Of course you still need to load the PHP5 module (libphp5.so) and the corresponding config file somewhere.
But I get the Access forbidden! in phpMyAdmin, and so does userdir.
Offline