安装Laravel项目的几种方法

安装方式1

laravel new my-bolg

安装方式2 使用composer安装(默认好像安装最新版本)

--prefer-dist 压缩版的意思

composer create-project laravel/laravel --prefer-dist

安装方式2.2 (安装指定版本)

composer create-project laravel/laravel=5.1 aiyouTest

修改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;
        }
}

启动laravel项目

启动方式1 使用PHP内置服务器启动

php -S localhost:8888 -t public

启动方式2 使用laravel提供的命令行工具 artisan

php artisan serve

results matching ""

    No results matching ""