首先去阿里雲或騰訊雲購買主機(騰訊雲如今有免費30天的雲主機...)php
購買好以後選擇安裝:html
點登錄 就能夠到linux的操做界面了mysql
進入操做界面linux
輸入root帳號密碼取得權限以後就能夠開始配置環境了sql
Apache安裝
yum install httpd
啓動
systemctl start httpd.service #啓動
systemctl stop httpd.service #中止
systemctl restart httpd.service #重啓
第2、設置開機啓動/關閉
systemctl enable httpd.service #開機啓動
systemctl disable httpd.service #開機不啓動
第3、檢查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.servicecurl
網站文件夾:
/var/www/html
網站
而後把你的PHP文件上傳到html文件夾裏去瀏覽器中輸入主機IP就能夠了
還有個比較簡單的方法就是用WDCP雲主機服務器管理系統,這個系統集成了PHP的運行環境很是方便。
這個是下載地址:http://www.wdlinux.cn/bbs/thread-57643-1-1.html
安裝好了以後輸入ip地址+端口8080就能夠進入操做界面了。
嗯OK了登錄進去按照你的須要去上傳網頁配置數據庫就行了。