I am installing Laravel on Yosemite, with PHP installed under MAMP. I have already installed Composer in Terminal successfully.
The problem is that I have an older PHP version on my system (PHP 5.5.20 (cli)
), while the PHP version in MAMP is 5.6.7.
As a result, I have the following error message
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.
So I followed this very useful link to install Laravel with Mamp, which includes a great post in the comments section from Phil T. [link]http://shabeebk.com/blog/how-to-install-laravel-in-mamp/#comments
Given that mcrypt already exists in MAMP but not on my system, could you please detail the PATH command I should write to solve this? Thanks for your help guys!
I think maybe you're using default php builded on yosemite.
Type php --ini
in terminal. you'll see information about php.ini file. for exp.
Configuration File (php.ini) Path: /Applications/XAMPP/xamppfiles/etc
Loaded Configuration File: /Applications/XAMPP/xamppfiles/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
which php
and you'll see path of php folder for exp./Applications/XAMPP/xamppfiles/bin/php
If it's different than MAMP folder (if it's default - /usr/bin/php
)
Change it to MAMP folder. To do it you need to change .bash_profile and add the MAMP version of PHP to the PATH variable.
You can edit .bash_profile with vim. Export the path variable with command
export PATH=/Applications/MAMP/bin/php/php[php.version]/bin:$PATH
Finally, check again if php path is correct with commands php --ini
or which php