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

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

猜你喜欢

转载自blog.csdn.net/duzilonglove/article/details/80682775