I’m running Ubuntu 16.04 along with PHP7.0 and was running into this error when trying to use Apache Event MPM:
Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
I found a lot of people suggesting to move from the Apache Event MPM over to the Apache Prefork MPM, but prefork is too slow under load in my configuration.
After some searching, I found this post by Tim Jones pointed me to the PPA maintained by Ondrej Sury that fixed the problem in PHP7 for me. Here are the specific steps I used:
sudo apt-add-repository -y ppa:ondrej/php sudo apt-get update sudo apt-get install libapache2-mod-fastcgi php7.0-fpm apache2
Those updates fixed the error and let me run the Apache Event MPM per my settings documented in this post.