0

I am having Ubuntu 14.10 and Apache 2.4. Currently Apache is running default mpm_prefork and I want to change it to mpm_worker.

I followed this Apache enable worker mpm to disable mpm_prefork and enable mpm_worker but it is giving error "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP." when I am restarting apache.

Now this is because php 5 doesn't work with mpm_worker so -

I followed this How to configure Apache to run PHP as FastCGI on Ubuntu 12.04 via terminal? and now I am running fastcgi as shown in phpinfo.

enter image description here

Everything looks fine but again, when I am disabling mpm_prefork and enabling mpm_worker, I am getting this error

"Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP."

So I have have to go to default prework module to keep the site running. I am not sure what else to be done, any help ?

  • 1
    For thorough discussion, see stackoverflow.com/questions/1623914/…. As you are using FastCGI, you should disable mod_php, so it is not loaded by apache. – ridgy Jan 31 '17 at 10:37
  • @ridgy - I ran a2dismod php5 and it is shwoing "Module php5 already disabled". I have also ran apt-get remove libapache2-mod-php5 still not able to run mpm_worker as it is giving same error. – iCyborg Jan 31 '17 at 12:43
  • 1
    Maybe somewhere in the apache configuration tree some php module is loaded (different from that installed by apt-get?) try cd /etc/apache2; . envvar; apache2 -D DUMP_MODULES -t – ridgy Jan 31 '17 at 12:55
  • Thanks, I figured out. There php5filter mod enabled. Once I disabled it, I was able to move to worker from prefork. – iCyborg Jan 31 '17 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.