ubuntu install laravel nginx

apt-get update
apt-get install nginx php5-fpm php5-cli php5-mcrypt git

vim /etc/php5/fpm/php.ini
cgi.fix_pathinfo=0

mkdir -p /var/www/laravel
vi /etc/nginx/sites-available/default

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /var/www/laravel/public;
index index.php index.html index.htm;

server_name server_domain_or_IP;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

cd ~
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
composer create-project laravel/laravel /var/www/laravel

Leave a Reply

Your email address will not be published. Required fields are marked *