I have a ubuntu 14.04.4 server box and I have installed apache2 and php5 packages but after enabling mpm_worker and restart apache I got following error
" 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"
I googled this but i am unable to fix the problem. Can anyone take me to the right direction?
Ubuntu – Configuring apache2-mpm-worker with php5
apache-2.2mpm-workerphp5Ubuntu
Related Topic
- Apache2 + mod_fastcgi + suexec + php5.2 = unstable on high load
- Apache2 refuses to process php files – “Snow Leopard” OSX 10.6.4
- Apache 2.2 – PHP + Fcgid Hangs If Download Interrupted
- Php – How to override mod-php5’s .php mapping to php4-cgi per VirtualHost or Directory
- apache – Selecting the Right MPM
- Apache mpm-worker + mod_fcgid + php5_cgi partially and sporadically down
- Change apache MPM prefork to worker on Amazon Linux AMI
Best Answer
Ubuntu's PHP5 module will only work with the single-threaded mpm_prefork. In order to use the Apache module with the threaded mpm_worker, you will need to compile a threadsafe version of PHP yourself (which requires disabling all of the features and modules of PHP that are not threadsafe, which are a lot of them).
Instead of using
libapache2-mod-php5
you should consider using FastCGI/php-fpm. There is a guide to the steps needed to install and configurelibapache2-mod-fastcgi
andphp5-fpm
here: https://askubuntu.com/a/527227 Part of configuring FPM is to create "pools" of php processes, each of which have their own limits and INI files, so you will need to be sure that the limits in FPM are reasonable for your site's expected load.This arrangement will allow you to use the multi-threaded worker MPM in Apache while handing off the PHP requests to individual PHP processes handling a single request each.