安装 Laravel 之前的步骤
安装composer
composer 是php的包管理工具,简单说 就是我们可以通过composer重用一些别人的代码
下载目录
curl -sS https://getcomposer.org/installer | php
安装composer后,将composer 移动到bin目录下,全局使用
mv composer.par /usr/local/bin/composer
最好更换composer源
composer config -g repositories.packagist composer https://packagist.phpcomposer.com
packagist 这个网站可以找到所有 composer 管理的扩展包
安装laravel
安装laravel 指定版本
composer create-project laravel/laravel=5.1 aiyouTest
安装laravel 最新版本
composer create-project laravel/laravel --prefer-dist
laravel的nginx的配置项
server {
listen 80 ;
server_name t.aiyou.cc;
root /Users/cven/www/aiyouTest/public;
location / {
index index.php index.html indexhtm;
if ( !-e $request_filename ) {
rewrite ^(.*)$ index.php?_url=$1 last;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}