PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, March 17, 2022

[FIXED] How to align my PHP version on my Mac with the PHP version installed in MAMP during Laravel installation?

 March 17, 2022     laravel, macos, mamp, php     No comments   

Issue

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!


Solution

I think maybe you're using default php builded on yosemite.

  1. 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)

    1. Or type 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



Answered By - Ilkinium
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing