linux配置PHP環境!!(雲服務器架設)


首先去阿里雲或騰訊雲購買主機(騰訊雲現在有免費30天的雲主機...)

 

購買好之后選擇安裝:

 

點登陸 就可以到linux的操作界面了

 進入操作界面

輸入root賬號密碼取得權限之后就可以開始配置環境了

 

Apache安裝
yum install httpd
啟動
systemctl start httpd.service #啟動
systemctl stop httpd.service #停止
systemctl restart httpd.service #重啟
第二、設置開機啟動/關閉
systemctl enable httpd.service #開機啟動
systemctl disable httpd.service #開機不啟動
第三、檢查httpd狀態
systemctl status httpd.service

 

關閉防火牆
關閉:systemctl stop firewalld.service
查看狀態:systemctl status firewalld.service

 

PHP安裝
yum -y install php

php各項服務安裝:
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-mysql

 

安裝MariaDB數據庫
CentOS 7.0中,已經使用MariaDB替代了MySQL數據庫,原因你懂的,MYSQL被Oracle收購以后,前景堪憂,所以MYSQL兄弟MariaDB就出來了,繼續開源事業。
安裝:yum -y install mariadb-server mariadb-client
啟動:systemctl start mariadb.service
停止:systemctl stop mariadb.service
查看狀態:systemctl status mariadb.service
開機啟動:systemctl enable mariadb.service
重啟:systemctl restart mariadb.service

 

網站文件夾:
/var/www/html

然后把你的PHP文件上傳到html文件夾里去瀏覽器中輸入主機IP就可以了

 

 

還有個比較簡單的方法就是用WDCP雲主機服務器管理系統,這個系統集成了PHP的運行環境非常方便。

 

這個是下載地址:http://www.wdlinux.cn/bbs/thread-57643-1-1.html   

 

安裝好了之后輸入ip地址+端口8080就可以進入操作界面了。

 

嗯OK了登陸進去按照你的需要去上傳網頁配置數據庫就好了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM