1. 程式人生 > >lampapache+mysql+php

lampapache+mysql+php

linux+apache

l 就是linux ,a就是apache,m就是apache,p就是php


apache

安裝apache

yum insatll httpd -y

開啟apache服務

service httpd start

設置235運行級別開機啟動

chkconfig --levels 235 httpd on

配置httpd文件

vi /etc/httpd/conf/httpd.conf

ServerName去掉#

重啟httpd服務

service httpd restart


mysql

安裝mysql數據庫

yum install mysql mysql-sever -y

開啟mysql數據庫

service mysqld start

chkconfig --levels 235 mysqld on

設置mysql數據庫密碼

mysql_secure_installation

2y其余回車

登陸數據庫

mysql -u root -p


Php

安裝php

yum install php* -y

開啟php

service httpd restart

編寫php測試頁面

vi /var/www/html/info.php

輸入

<?php

phpinfo();

?>

重啟httpd服務

service httpd restart


lampapache+mysql+php