【www.bbyears.com--php安装】
一:安装composer包管理工具,这个不作过多赘述:
使用 curl 指令下载:
curl -sS https://getcomposer.org/installer | php
或是?]有安? curl ,也可以用 php 指令下载:
php -r "readfile('https://getcomposer.org/installer');" | php
或是手动下载 composer.phar
二:composer 安装,运行命令:
composer create-project laravel/laravel learnlaravel5 5.0.22 laravel5-install
三:安装时如果出现以下错误:
Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for laravel/framework v5.0.16 -> satisfiable by laravel/framework[v5.0.16]. - laravel/framework v5.0.16 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
解决方案:我本地安装MAMP集成开发环境:
which php 查看php执行路径,发现时 usr/bin/php说明是系统自带的php版本
cd ~ vim /.bash_profile
添加一行:
export PATH=/Applications/MAMP/bin/php/php5.6.7/bin:$PATH source .bash_profile
which php 此时查看php执行的是mamp php