1.安装composer
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');
2.将composer变成全局可用
sudo mv composer.phar /usr/local/bin/composer
3.使用composer安装laravel
composer create-project laravel/laravel laravel54 "5.4.*"
4.将根目录配置到 laravel54/public 下即可
5.自定义的路由找不到
因为 mod_rewrite 模块没打开
1.sudo vim /etc/apache2/httpd.conf
2.LoadModule rewrite_module libexec/apache2/mod_rewrite.so 去掉该行前面的#
3.vim /etc/apache2/extra/httpd-vhosts.conf
4.修改 Directory标签内的内容的如下
<Directory "/Users/user/wwwroot/xxx/laravel54/public"> Options FollowSymLinks AllowOverride All Require all granted </Directory>
5. sudo apachectl restart