apt-get update && apt-get upgrade安裝nginx、php5-fpm(解析php)、php5-mcrypt(Laravel 4需求套件)、php5-cli & git(composer需求套件)
apt-get install nginx php5-fpm php5-cli php5-mcrypt git設定 nginx的VirtualHost
/etc/nginx/sites-available/default
server {修改fpm設定檔
listen 80 default_server;
root /home/kejyun/laravel/public/;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
sudo vim /etc/php5/fpm/pool.d/www.conf將
listen = /var/run/php5-fpm.sock修改為
listen = 127.0.0.1:9000重新啟動php-fpm及nginx
service php5-fpm restart修正Laravel 4資料夾群組及寫入權限問題
service nginx restart
sudo chgrp -R www-data /home/kejyun/laravel
sudo chmod -R 775 /home/kejyun/laravel/app/storage
Let's play Laravel 4 with nginx!!
沒有留言:
張貼留言