道者编程

apache和php

1:整合apache和php
(1): 
# vi /usr/local/apache2/conf/httpd.conf
 
(2):在AddType application/x-gzip .gz .tgz下边添加
# AddType application/x-httpd-php .php
# AddType application/x-httpd-php-source .phps
( 注意.php前有一个空格)

 把DirectoryIndex index.html改成
 DirectoryIndex index.html index.php

2:/usr/local/apache2/bin/apachectl start
安装PHP后启动apache,启动提示:httpd: Syntax error on line 53 of
/usr/local/apache2/conf/httpd.conf: Cannot load
/usr/local/apache2/modules/libphp5.so into server:
/usr/local/apache2/modules/libphp5.so: cannot restore segment prot after
reloc: Permission denied
 
1:看看权限,ROOT,2:检查libphp5.so是否存在;3:关闭selinux
关闭:
# vi /etc/sysconfig/selinux 
 
# 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 
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted
改为SELINUX=disable
重启后生效


要不重启的话,执行命令:
# setenforce 0
 
就可以不重启关闭selinux了,推荐先关闭,然后再输入命令,这样不用重启,下次重启后也就自动关闭了!

最新评论:
我要评论:

看不清楚