搭建步驟
1楚殿、install PHP
brew install php60
2署驻、install Composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
or user curl to install
curl -sS [https://getcomposer.org/installer](https://getcomposer.org/installer) | php
下載 composer.phar 后,將它放到 usr/local/bin 目錄中中,成為全域指令历恐。
mv composer.phar /usr/local/bin/composer
配置composer環(huán)境變量:
export PATH=~/.composer/vendor/bin:$PATH
此時終端運行composer命令,若出現(xiàn)權限問題专筷,給文件加權限:
sudo chmod a+x composer.phar
3弱贼、create new application
laravel new blog
or
composer create-project --prefer-dist laravel/laravel blog
4、啟動本地服務
php artisan serve
成功后會出現(xiàn):
Laravel development server started: <http://127.0.0.1:8000>