简体   繁体   English

在ubuntu 16上使用php7的Apache2错误

[英]Apache2 error with php7 on ubuntu 16

apache gives me an error when i try to start the service with php7 mod enabled. 当我尝试启用php7 mod启动服务时,apache给了我一个错误。 this is the error: 这是错误:

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

anyone knows how to solve it? 谁知道怎么解决呢?

If you want to just get in running somehow and you are on a linux system(ubuntu 14.04 in this case), you can run the following commands: 如果你想以某种方式进入运行并且你在Linux系统(在这种情况下是ubuntu 14.04),你可以运行以下命令:

sudo a2dismod mpm_event

sudo a2enmod mpm_prefork

The above two commands are basically disabling the event module and instead using the prefork module. 以上两个命令基本上禁用事件模块,而是使用prefork模块。

For systems other than linux you can see for references on how to enable disable modules and just enable/disable the mentioned modules. 对于Linux以外的系统,您可以查看有关如何启用禁用模块的参考,并启用/禁用所提及的模块。

Note: I don't know what can be the performance or other implications of such a change. 注意:我不知道这种改变的性能或其他影响。 The above solution is derived from here 上述解决方案源自此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM