20
votes

I am running php 5.5 and apache 2 on debian 7 (wheezy) i have installed php module for apache but it's not enable whithout enabling php module for apache i will see php files as plain text and when i enabled php module whith a2enmod i can not start apache and it gives this error

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

how can i fix this problem

3
@Halcyon No he does not!!!Mehraban

3 Answers

29
votes

Disabling mpm_event and enabling mpm_prefork worked for me.

sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
10
votes
apache2ctl configtest

sudo apt-get install php7.0
sudo apt-get install php7.0-fpm
sudo a2enmod php7.0
sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
sudo service apache2 restart
5
votes

The PHP manual does not recommend this

You can run a fast-CGI version of PHP though:

apt-get install php5-fpm should install it for you.