附加: PHP上面接Apache下面接MySQL,所有PHP最后配置
附加: Build complete. 这个就是成功了 Don’t forget to run ‘make test’. 检查php是否正常(浪费时间)
cp php.ini-development /usr/local/php5/php.ini #php配置文件 ln -s /usr/local/php5/bin/* /usr/local/bin/ #优化路径 vi /etc/httpd.conf #让Apache配置文件中识别PHP AddType application/x-httpd-php .php #让Apache交给PHP处理动态请求 AddType application/x-httpd-php-source .phps systemctl restart httpd #重启httpd !vi #返回上一次编辑文件(无论当前位置都能回到原配置文件) DirectoryIndex index.php index.html #识别两个不同类型(.php .html) systemctl reload httpd #重启httpd问题:
Failed to reload httpd.service: Job type reload is not applicable for unit httpd.service. See system logs and 'systemctl status httpd.service' for details.原因: 没开启httpd服务 systemctl restart httpd
cd /usr/local/httpd/htdocs/ mv index.html index.php vi index.html <?php phpinfo(); ?>完成就可以去浏览器上测试了 在网页测试“http://IP地址/index.php”