laravel 关于一个优雅的框架安装 (mac)

安装composer
准备好homebrew工具
brew install composer #安装composer
不是mac os 只要想办法安装上composer就可以继续

php54-mcrypt 模块
brew install homebrew/php/php54-mcrypt #安装
缺少该模块会导致报错

用composer安装laravel
composer create-project laravel/laravel –prefer-dist
完成后的记录
Generating autoload files
> php artisan clear-compiled
> php artisan optimize
Generating optimized class loader
Compiling common classes
> php -r “copy(‘.env.example’, ‘.env’);”
> php artisan key:generate
Application key [0DfkzQ8kYye9tBbtz8zi2xPkeEKfpwk9] set successfully.

laravel下的storage 和 vendor 目录要让服务器有写入的权限
chmod -R 777 storage
chmod -R 777 vendor

Apache 开启 mod_rewrite 模块
在 httpd.conf 中找到 #LoadModule rewrite_module 去掉注释

发表评论