Ubuntu下安装php7后无法启动Apache

时间:2023-03-09 16:11:23
Ubuntu下安装php7后无法启动Apache
 报错提示:Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP

由于Apache的运行模式和非线程安全版的php不兼容,所以是需要更改Apache的工作模式。Apache是通过Ubuntu下

 apt-get install apache2

安装的,所以在/etc/apache2/目录下有两个文件夹,一个mods-avaiable一个mods-enabled.

将mods-enabled目录下的mpm-event的conf和load链接删除。重建prefork链接

 cd mods-enabled/
ln -s ../mods-available/mpm_prefork.* .

重启apache2,ok了。

Ubuntu下安装php7后无法启动Apache

参考:

http://php.net/manual/zh/faq.installation.php#faq.installation.apache2

http://www.cnblogs.com/fnng/archive/2012/11/20/2779977.html

http://www.open-open.com/lib/view/open1464766095184.html