首先安裝httpd 相關軟件包
yum install httpd httpd-devel httpd-manual httpd-tools -y
啓動httpd服務
service httpd restart
將httpd服務添加到開機自啓動
chkconfig httpd on
此時在瀏覽器中輸入本機ip已經能打開apache測試網站,注意修改防火牆策略
安裝mysql
yum install mysql mysql-devel php-mysql mysql-server -y
將mysqld服務加到開機自啓動
chkconfig mysqld on
啓動mysql服務
service mysqld start
安裝php及相關軟件包
yum install php-common php php-devel php-gd php-imap php-ldap php-mbstring php-pear php-xml php-xmlrpc -y
cd /var/www/html/
vim index.php
<?php
phpinfo();
?>
啓動httpd服務
service httpd restart
此時在瀏覽器中輸入本機ip已經能打開php測試網站