启动Apache httpd报错Cannot load /etc/httpd/modules/libphp5-zts.so into server 解决方案

作者新建了QQ群:460430320,供大家交流测试心得(培训机构勿进)。另外,还会不定期上传测试资料,也欢迎您共享测试资料。

Symptoms

Apache cannot start on Linux Shared Hosting NG webserver after PHP 5.3 was upgraded to php53-5.3.3-5.el5 (using the command yum update php53) with the error message below:

[root@Beta-nginx conf]# service httpd start
正在启动 httpd:httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 9 of /etc/httpd/conf.d/php.conf: Cannot load /etc/httpd/modules/libphp5-zts.so into server: /etc/httpd/modules/libphp5-zts.so: cannot open shared object file: No such file or directory
[失败]

Cause

The PHP module libphp5-zts.so is absent on a webserver. It also cannot be found in Cloudlinux repository, yum cannot find it:

# yum search php-zts*
Loaded plugins: fastestmirror, rhnplugin
Loading mirror speeds from cached hostfile
 * cloudlinux-base-h2e: repo.cloudlinux.com
 * cloudlinux-x86_64-server-5: xmlrpc.cln.cloudlinux.com
Reducing repo-id-7 to included packages only
Finished
Warning: No matches found for: php-zts*
No Matches found

During PHP 5.3 upgrade the following directive is being configured in the file /etc/httpd/conf.d/php.conf which is included from the main Apache configuration file /etc/httpd/httpd.conf:

<IfModule worker.c>
   LoadModule php5_module modules/libphp5-zts.so
</IfModule>

So, Apache is configured to load absent PHP module and it cannot start due to this misconfiguration.

#Resolution

The workaround:

Comment the directive which loads libphp5-zts.so module in the file /etc/httpd/conf.d/php.conf
Start Apache

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页