[~] $ which php
/usr/bin/php
[~] $ php -v
PHP 5.5.38 (cli) (built: Aug 21 2016 21:48:49)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
[~] $
Laravel 5.3 要求
PHP >= 5.6.4
这里使用xampp提供的一键包
https://sourceforge.net/projects/xampp/files/XAMPP%20Mac%20OS%20X/
选择一个最新版本
[xampp-osx-7.0.9-2-installer.dmg]
安装完成后
编辑.bash_profile
export XAMPP=/Applications/XAMPP/bin
export PATH=$XAMPP:$PATH
[~] $ which php
/Applications/XAMPP/bin/php
[~] $ php -v
PHP 7.0.9 (cli) (built: Aug 26 2016 06:17:04) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
安装 compress
https://getcomposer.org/download/
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'aa96f26c2b67226a324c27919f1eb05f21c248b987e6195cad9690d5c1ff713d53020a02ac8c217dbf90a7eacc9d141d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
下载得到composer.phar
sudo mv composer.phar /usr/local/bin/composer
全局安装laravel
composer global require "laravel/installer"
laravel new blog
需要配置path
~/.composer/vendor/bin
或在线创建项目
composer create-project --prefer-dist laravel/laravel blog
启动服务器
cd blog
php artisan serve
另外这里有一些xampp扩展
https://bitnami.com/stack/xampp
http://laravelacademy.org/
https://laravel-china.org/
https://laravel.com/
http://www.golaravel.com/
http://lumen.golaravel.com/