REQUIREMENTS
實際需要使用到的:
文章中需要使用到:
INSTALL
在終端機上執行以下command:
1 | sudo apt-get update |
QUICK START
抓取yii的source:
1 | git clone https://github.com/yiisoft/yii.git |
建立一個webapp:
1 | mkdir webapp |
建立完後的目錄結構:
1 | . |
其中assets、runtime和data,必須要讓www-data(nginx、apache)有讀、寫和執行的功能,可使用設定群組的方式,或者執行chmod -R 777 assets protected/runtime protected/data
。
打開nginx config:
1 | sudo vi /etc/nginx/sites-enabled/default |
修改以下這兩個location,設定你的webapp位置和設定fastcgi連接到php-fpm:
1 | location / { |
如果使用的是nginx和php-fpm,請檢查php-fpm的listen設定,對應上面的fastcgi_pass
。檔案位置在/etc/php5/fpm/pool.d/www.conf
。
設定完之後,重開nginx:
1 | sudo /etc/init.d/nginx restart |
在瀏覽上打開http://localhost/,就可以看到剛剛佈署完的結果了。