1. 程式人生 > >linux配置PHP環境!!(雲服務器架設)

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

方便 string -s iad thread systemctl 1-1 賬號密碼 系統集成

首先去阿裏雲或騰訊雲購買主機(騰訊雲現在有免費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了登陸進去按照你的需要去上傳網頁配置數據庫就好了。

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