11.14 Apache和PHP结合

11.14 Apache和PHP结合

 1.编辑httpd配置文件   vim /usr/local/apache/conf/httpd.conf

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.16.15.246. Set the 'ServerName' directive globally to suppress this message
httpd (pid 14596) already running

#ServerName www.example.com:80    去掉注释

Require all  denide  改为  Require all granted

/usr/local/apache/bin/apachectl  -t  //查看语法是否正确

/usr/local/apache/bin/apachectl graceful   //重新加载配置文件

AddType application/x-httpd-php .php    //增加一行配置

增加php索引页  index.php

 测试解析是否正常

<?php
phpinfo();
?>

解析不正常检查:

/usr/local/apache/bin/apachectl -M    检查是否加载php模块

LoadModule php5_module        modules/libphp5.so    查看配置文件

AddType application/x-httpd-php .php   查看配置文件

猜你喜欢

转载自my.oschina.net/u/3803395/blog/1810524