通過yum安裝httpd php php-pfm mysql mariadb php-mysql
注意:mysql 在centos 7.0以後的服務版本為mariadb
安裝方法如下:
wget
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server (提示輸入yes確定即可)
安裝基本擴充套件包
安裝apache擴充套件包
安裝php擴充套件包
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-devel
安裝mysql擴充套件包
yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
配置apache 和mysql開機自啟動
apache
systemctl start httpd.service #啟動apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重啟apache
systemctl enable httpd.service #設定apache開機啟動
mysqld
systemctl start mysqld.service
systemctl stop mysqld.service
systemctl restart mysqld.service
systemctl enable mysqld.service
啟動對應服務
測試php環境
cd /var/www/html/
vim index.php
<?php echo "
test php"; phpinfo() ?>
重啟php ,systemclt restart php-fpm.service
lamp 環境測試完成!!!!!!
CentOS 7 5 系統下安裝nginx
選擇你想要安裝的位址 cd usr local etc wget 安裝nginx執行庫 yum y install gcc gcc c automake autoconf libtool make yum y install pcre zlib openssl openssl devel 解壓ngi...
centos7 5開啟ssh服務
1,檢視是否已安裝openssh server 指令 rpm qa grep ssh 2,如果未安裝,請先安裝openssh server 修改埠號 允許root登入 設定需要密碼登入 修改好後輸入 wqa 儲存退出 4,開啟ssh服務 systemctl start sshd.service 5,...
centos7 5基本命令
1 檢視系統對外開放埠。firewall cmd list ports 2 永久開放某埠 firewall cmd zone public add port 3306 tcp permanent firewall cmd reload 3 檢視開機啟動項 systemctl list unit fi...