apahce 的 worker.c 模式

来源:互联网 发布:番摊软件下载 编辑:程序博客网 时间:2024/06/08 12:34

由于最近公司开发新项目,要求多线程并发,不得已只能配置apache从prefork模式转向worker模式。

原本以为就是换换运行文件,把httpd.work改名为httpd 替换掉默认文件就行了。(默认的httpd是httpd.prefork)


但突然就发现系统不支持mysql了,后来发现,只要phpinfo()里查到,预编译命令里加了--without-XXX的组合,即不接受动态加载。

所以不得已只能重新手动编译PHP,但是apahce启动的时候出现错误: 

 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.


这个错误提示是,apache是多线程模式(我已经用httpd.work替换了默认的httpd),而php是非线程模式必须重新编译。

后来发现预编译的时候需要加入预编译项   --enable-maintainer-zts ,不能加入 --with-openssl

原创粉丝点击