# centos7.0+php7.1環境配置文檔
CentOS 7.0(64位)安裝配置LAMP服務器(Apache+PHP+MariaDB)
一、配置防火墻,開啟80端口、3306端口
CentOS 7.0默認使用的是firewall作為防火墻。
1、開啟firewall:
systemctl start firewalld.service #開啟firewall
systemctl enable firewalld.service #設置firewall開機啟動
2、配置firewalld防火墻
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-service=mysql
firewall-cmd --reload
二、關閉SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注釋掉
#SELINUXTYPE=targeted #注釋掉
SELINUX=disabled #增加
:wq! #保存退出
setenforce 0 #使配置立即生效
安裝篇:
一、安裝Apache
yum install httpd #根據提示,輸入Y安裝即可成功安裝
systemctl start httpd.service #啟動apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重啟apache
systemctl enable httpd.service #設置apache開機啟動
二、安裝MariaDB
CentOS 7.0中,已經使用MariaDB替代了MySQL數據庫
1、安裝MariaDB
yum install mariadb mariadb-server #詢問是否要安裝,輸入Y即可自動安裝,直到安裝完成
systemctl start mariadb.service #啟動MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重啟MariaDB
systemctl enable mariadb.service #設置開機啟動
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf #拷貝配置文件(注意:如果/etc目錄下面默認有一個my.cnf,直接覆蓋即可)
2、為root賬戶設置密碼
mysql\_secure\_installation
回車,根據提示輸入Y
輸入2次密碼,回車
根據提示一路輸入Y
最后出現:Thanks for using MySQL!
MariaDB密碼設置完成,重新啟動 MariaDB:
systemctl restart mariadb.service #重啟MariaDB
三、安裝PHP
安裝PHP7.1組件,使PHP支持 MariaDB
yum install epel-release -y
rpm -Uvh[https://mirror.webtatic.com/yum/el7/webtatic-release.rpm](https://mirror.webtatic.com/yum/el7/webtatic-release.rpm)
yum install php71w php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath libjpeg php71w-ldap php71w-odbc php71w-pear php71w-xmlrpc
php71w-mcrypt -y
安裝解壓縮軟件和上傳插件(可選)
yum install unzip lrzsz -y
systemctl restart mariadb.service #重啟MariaDB
systemctl restart httpd.service #重啟apache
四、安裝ioncube\_loader
1.下載:ioncube\_loader(64位操作系統)
[http://www.yuanfengtest.com/php7.1/ioncube7.1.zip](http://www.yuanfengtest.com/php7.1/ioncube7.1.zip)
2.安裝 ioncube\_loader
解壓后將 ioncube\_loader\_lin\_7.1.so 拷貝到服務器 /usr/lib64/php/modules 目錄
將00-ioncube.ini 拷貝到服務器 /etc/php.d/ 目錄下
完成后重啟apache:systemctl restart httpd.service
配置篇
一、Apache配置
vi /etc/httpd/conf/httpd.conf #編輯文件
ServerSignature On #添加,在錯誤頁中顯示Apache的版本,Off為不顯示
Options Indexes FollowSymLinks #修改為:Options Includes ExecCGI FollowSymLinks(允許服務器執行CGI及SSI,禁止列出目錄)
AllowOverride None #修改為:AllowOverride All (允許.htaccess)
#Options Indexes FollowSymLinks #修改為 Options FollowSymLinks(不在瀏覽器上顯示樹狀目錄結構)
DirectoryIndex index.html #修改為:DirectoryIndex index.html index.php(設置默認首頁文件,增加index.php)
wq! #保存退出
systemctl restart httpd.service #重啟apache
rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html #刪除默認測試頁
二、php配置
vi /etc/php.ini #編輯
expose\_php = Off #禁止顯示php版本的信息
short\_open\_tag = ON #支持php短標簽
:wq! #保存退出
systemctl restart mariadb.service #重啟MariaDB
systemctl restart httpd.service #重啟apache
測試篇
cd /var/www/html
vi index.php #輸入下面內容
:wq! #保存退出
在客戶端瀏覽器輸入服務器IP地址,可以看到相關的配置信息!
注意:apache默認的程序目錄是/var/www/html
權限設置:chown apache.apache -R /var/www/html
至此,CentOS 7.0安裝配置LAMP服務器(Apache+PHP+MariaDB)教程完成!
- 軟件介紹
- 商城系統介紹
- 平臺初始化
- 基礎設置
- 商品設置
- 店鋪設置
- 會員管理
- 運營設置
- 電腦端設置
- 手機端設置
- 小程序端設置
- 騎手配送設置
- 商家入駐
- 商家注冊
- 商品發布
- 圖片空間
- 商品導入
- 促銷活動
- 預售
- 團購
- 加價購
- 限時折扣
- 滿即送
- 代金券
- 拼團
- 砍價
- 積分商城
- 公眾號
- 門店自提(線上支付,線下提貨)
- 供應商入駐
- 買家注冊
- 注冊
- 購買
- 發貨/收貨
- 白條
- 購物卡充值購買
- 分銷
- 分銷設置
- 小程序
- 直播功能申請
- 騰訊云申請配置
- uniapp后臺模塊裝修
- 購買服務器篇
- 阿里云
- 百度云
- 商城安裝
- 商城安裝操作指南
- Centos7.0環境配置操作指南
- PHP5.4-PHP5.6配置文件下載
- 正式商城安裝操作指南
- centos7.0+php7.1環境配置文檔