shutdown -r 0
看到文章
http://bbs.ywlm.net/thread-920-1-1.html
apache有两种运行模式:
prefork模式
worker模式
两种模式区别请看:http://bbs.ywlm.net/thread-919-1-1.html
我编译的时候用了--with-mpm=worker即worker模式
但是,worker模式很多第三方模块不支持的
后来用--with-mpm=prefork重新编译apache就OK了
就把文件替换(理解错误啦,请先看全部的再操作啊,后面有注释)
[root@localhost ~]# cd /usr/sbin/
[root@localhost sbin]# ll httpd*
-rwxr-xr-x. 1 root root 341200 Feb 14 2012 httpd
-rwxr-xr-x. 1 root root 356536 Feb 14 2012 httpd.event
-rwxr-xr-x. 1 root root 353112 Feb 14 2012 httpd.worker
[root@localhost sbin]# service httpd stop
Stopping httpd: [ OK ]
[root@localhost sbin]# mv httpd httpd.bak
[root@localhost sbin]# mv httpd.worker httpd
[root@localhost sbin]# service httpd restart
主要是吧httpd.worker替换成httpd
之后service httpd restart 会出现提示
[root@localhost sbin]# service httpd restart
Stopping httpd: [FAILED]
Starting 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
[root@localhost sbin]# yum install php-zts
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centosl3.centos.org
* extras: centosp4.centos.org
* updates: centosq2.centos.org
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-zts.i686 0:5.3.3-14.el6_3 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================================================
Installing:
php-zts i686 5.3.3-14.el6_3 updates 1.2 M
Transaction Summary
===============================================================================================================================================================================================
Install 1 Package(s)
Total download size: 1.2 M
Installed size: 3.5 M
Is this ok [y/N]: y
Downloading Packages:
php-zts-5.3.3-14.el6_3.i686.rpm | 1.2 MB 00:03
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-zts-5.3.3-14.el6_3.i686 1/1
Verifying : php-zts-5.3.3-14.el6_3.i686 1/1
Installed:
php-zts.i686 0:5.3.3-14.el6_3
Complete!
[root@localhost sbin]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[ OK ]
这就可以了~~
再查看日志
[root@localhost ~]# tail -f /etc/httpd/logs/*
Failed loading /usr/lib/php/modules/ZendGuardLoader.so: /usr/lib/php/modules/ZendGuardLoader.so: cannot enable executable stack as shared object requires: Permission denied
查看文章
http://v-vampires.iteye.com/blog/908297
在linux上安装有些东西时会出现 Permission denied 的情况:以下就是解决它的办法之一
编辑/etc/selinux/config,找到这段:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing 把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
保存,关闭。
[root@localhost sbin]# shutdown -r 0
重启后发现日志里有
Failed loading /usr/lib/php/modules/ZendGuardLoader.so: /usr/lib/php/modules/ZendGuardLoader.so: undefined symbol: compiler_globals
到此,发现最初的理解是错误的,改回来
[root@localhost ~]# cd /usr/sbin/
[root@localhost sbin]# mv httpd httpd.worker
[root@localhost sbin]# ll http*
-rwxr-xr-x. 1 root root 341200 Feb 14 2012 httpd.bak
-rwxr-xr-x. 1 root root 356536 Feb 14 2012 httpd.event
-rwxr-xr-x. 1 root root 353112 Feb 14 2012 httpd.worker
[root@localhost sbin]# mv httpd.bak httpd
[root@localhost sbin]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[ OK ]
[root@localhost sbin]#
再phpinfo()查看就有了