php php和apache线程安全错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19185268/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 18:58:40  来源:igfitidea点击:

php and apache thread safe error

phpapache

提问by zoli

I am running php 5.5 and apache 2 on debian 7 (wheezy) i have installed php module for apache but it's not enable whithout enabling php module for apache i will see php files as plain text and when i enabled php module whith a2enmod i can not start apache and it gives this error

我在 debian 7 (wheezy) 上运行 php 5.5 和 apache 2 我已经为 apache 安装了 php 模块,但它没有启用 php 模块为 apache 我会看到 php 文件为纯文本,当我启用 php 模块 whith a2enmod 我不能启动apache,它给出了这个错误

[crit] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP. Pre-configuration failed Action 'configtest' failed.

[crit] Apache 正在运行线程 MPM,但您的 PHP 模块未编译为线程安全的。您需要重新编译 PHP。预配置失败 操作“configtest”失败。

how can i fix this problem

我该如何解决这个问题

采纳答案by Cwissy

php do not recommend this: http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2

php 不推荐这个:http: //www.php.net/manual/en/faq.installation.php#faq.installation.apache2

you can run a fast-cgi version of php though:

不过,您可以运行快速 cgi 版本的 php:

apt-get install php5-fpm should get it for you.

apt-get install php5-fpm 应该会为您提供。

回答by Anbazhagan p

Disabling mpm_eventand enabling mpm_preforkworked for me.

禁用mpm_event和启用mpm_prefork对我有用。

sudo a2dismod mpm_event
sudo a2enmod mpm_prefork

回答by Roshan Weerasuriya

apache2ctl configtest

sudo apt-get install php7.0
sudo apt-get install php7.0-fpm
sudo a2enmod php7.0
sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
sudo service apache2 restart