1、購買阿里雲 centos 服務器
2、下載 Linux一鍵安裝web環境 ,並copy到服務器
3、執行一鍵安裝包(./install.sh),會自動清理之前一鍵安裝包安裝過的環境。
4、根據需要選擇相應軟件版本
5、查看密碼:
標准版:cat /alidata/account.log
專業版:cat /root/sh-1.5.4/account.log
注意:有可能不在這里,而是在下載目錄里
6、安裝 phpwind 和 phpmyadmin
直接在瀏覽器中輸入您的域名或者 ip,如果是第一次訪問 phpwind,則會自動跳轉到安裝頁面。
7、六、 環境目錄及相關操作命令
網站目錄:/alidata/www 服務器軟件目錄:/alidata/serverMysql 目錄 /alidata/server/mysql Php 目錄/alidata/server/php
Tomcat 目錄/alidata/server/tomcat7
選擇了 nginx 那么會有一個 nginx 目錄在 /alidata/server/nginx/
Nginx 配置文件在/alidata/server/nginx/conf
Nginx 虛擬主機添加 你可以修改/alidata/server/nginx/conf/vhosts/phpwind.conf
選擇了 apache 那么會有一個 httpd 目錄在 /alidata/server/httpd
apache 配置文件在/alidata/server/httpd/conf
apache 虛擬主機添加 你可以修改/alidata/server/httpd/conf/vhosts/phpwind.conf
各個服務操作命令匯總:
nginx: /etc/init.d/nginx start/stop/restart/reload) apache: /etc/init.d/httpd start/stop/restart/… mysql: /etc/init.d/mysqld start/stop/restart/… php-fpm:/etc/init.d/php-fpm start/stop/restart/… Tomcat: /etc/init.d/tomcat7 start/stop/restart/… ftp: /etc/init.d/vsftpd start/stop/restart/… 比如啟動 nginx: /etc/init.d/nginx start
8、 安裝 workerman 環境
http://www.workerman.net/install
1、在命令中運行 curl -Ss http://www.workerman.net/check.php | php 檢測本地環境是否滿足workerman。
他這個軟件包沒有 pcntl擴展,需要自己安裝一下,這個擴展安裝頭疼了我一天。不過今天突然就開竅了,其實也是很簡單,只不過之前算牛角尖了,一直出錯。
首先就是需要進入到php 源碼包的 pcntl目錄,
[root@iZ25pkurrazZ etc]# cd /mnt/sh-1.4.5/php-5.5.7/ext/pcntl/
然后
/alidata/server/php-5.5.7/bin/phpize && ./configure && make install 一下,
注意:如果報錯:configure: error: Cannot find php-config. Please use --with-php-config=PATH
,那么就需要找到 php-config , find / -name php-config,
找到 /alidata/server/php-5.5.7/bin/php-config,
所以 應該是:
/alidata/server/php-5.5.7/bin/phpize && ./configure --with-php-config=/alidata/server/php-5.5.7/bin/php-config && make install
再把 擴展加到php.ini 中,就行了,之前的錯誤就是因為寫錯了地方,這個軟件包的php.ini 在/alidata/server/php/etc/php.ini
,所以我們也要寫到這里
[root@iZ25pkurrazZ pcntl]# echo "extension=pcntl.so" >> /alidata/server/php/etc/php.ini
如果是 php-5.5.7,就是:
echo "extension=pcntl.so" >> /alidata/server/php-5.5.7/etc/php.ini
,完事兒!!!
對了,記得重啟下php 和服務器,apache 還是 nginx
重啟
nginx [root@iZ25pkurrazZ pcntl]# /etc/init.d/nginx restart
重啟php [root@iZ25pkurrazZ pcntl]# /etc/init.d/php-fpm restart
在 用 php -m ,發現 PDO 和 pcntl擴展都有了,再用 curl -Ss http://www.workerman.net/check.php | php檢測一下也可以了。
9、打開phpmyadmin ,創建數據庫,導入數據庫文件。
10、修改項目數據庫用戶名,密碼。
11、添加修改 xx.conf 虛擬主機文件
12、開啟 phpinfo,需要在php.ini 中關閉 ;short_open_tag = Off,重啟
更多學習內容請訪問:
八重櫻:騰訊T3-T4標准精品PHP架構師教程目錄大全,只要你看完保證薪資上升一個台階(持續更新)
以上內容希望幫助到大家,很多PHPer在進階的時候總會遇到一些問題和瓶頸,業務代碼寫多了沒有方向感,不知道該從那里入手去提升,對此我整理了一些資料,包括但不限於:分布式架構、高可擴展、高性能、高並發、服務器性能調優、TP6,laravel,YII2,Redis,Swoole、Swoft、Kafka、Mysql優化、shell腳本、Docker、微服務、Nginx等多個知識點高級進階干貨需要的可以免費分享給大家,需要的可以加入我的官方群點擊此處。