httpd启动错误和php项目访问空白页

错误1:

php项目部署成功后,在浏览器上输入地址显示空白页面

httpd的错误日志:

1
2
3
4
5
6
7
[Wed Sep 12 22:01:33.752236 2018] [mpm_prefork:notice] [pid 1575] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Sep 12 22:01:34.794920 2018] [core:notice] [pid 1597] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Wed Sep 12 22:01:34.795422 2018] [suexec:notice] [pid 1597] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Sep 12 22:01:34.810608 2018] [auth_digest:notice] [pid 1597] AH01757: generating secret for digest authentication ...
[Wed Sep 12 22:01:34.811109 2018] [lbmethod_heartbeat:notice] [pid 1597] AH02282: No slotmem from mod_heartmonitor
[Wed Sep 12 22:01:34.824423 2018] [mpm_prefork:notice] [pid 1597] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
[Wed Sep 12 22:01:34.824446 2018] [core:notice] [pid 1597] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

解决方法:

关闭防火墙

1
systemctl stop firewalld

关闭SELinux

1
2
3
4
5
6
7
8
9
10
11
[root@centos ~]# vi /etc/selinux/config   #将enforcing改为disabled
# 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 - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

错误2

httpd: Could not reliably determine the server's fully qualified domain name

解决方法

1)进入apache的安装目录:(视个人安装情况而不同

1
cd /etc/httpd/conf/

2)编辑httpd.conf文件,搜索”#ServerName”,修改ServerName localhost:80

1
2
3
4
5
[root@server conf]# ls
extra httpd.conf magic mime.types original
[root@server conf]# vi httpd.conf
#ServerName www.example.com:80
ServerName localhost:80

3)再重新启动apache 即可。

1
systemctl restart httpd