1,安装httpd,php,php-fpm //php-fpm实际整合的是mod_php,从配置文件中可以看到
2,启动httpd
3,验证(增php测试页,测试)
1,安装httpd,php,php-fpm
[root@node2 ~]# yum install httpd php php-fpm -y
..................................
Dependencies Resolved
=============================================================================================
Package Arch Version Repository Size
=============================================================================================
Installing:
httpd x86_64 2.4.6-93.el7.centos base 2.7 M
php x86_64 5.4.16-48.el7 base 1.4 M
php-fpm x86_64 5.4.16-48.el7 base 1.4 M
Installing for dependencies:
apr x86_64 1.4.8-5.el7 base 103 k
apr-util x86_64 1.5.2-6.el7 base 92 k
httpd-tools x86_64 2.4.6-93.el7.centos base 92 k
libzip x86_64 0.10.1-8.el7 base 48 k
mailcap noarch 2.1.41-2.el7 base 31 k
php-cli x86_64 5.4.16-48.el7 base 2.7 M
php-common x86_64 5.4.16-48.el7 base 565 k
Transaction Summary
=============================================================================================
Install 3 Packages (+7 Dependent packages)
..................................
2,启动httpd
[root@node2 ~]# systemctl start httpd
[root@node2 ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
备注:不用启动php-fpm,这个很是奇怪?
A:php依赖httpd,而mod-php已经进行了整合,所以只需要启动httpd即可
3,验证(增php测试页,测试)
浏览器中输入IP地址
a,首先测试appache web
b,在/var/www/html/文件夹下建立php测试页面
[root@node2 ~]# cat /var/www/html/index.php
<?php
phpinfo();
?>
php-fpm是整合的mod_php
[root@node2 ~]# vim /etc/httpd/conf.modules.d/10-php.conf
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>