0

Please bear with me here for a second. I am quite new to working with frameworks especially Laravel. However, I have seriously tried to set everything up using various tutorials and the documentation.

I am now using MAMP as my local server and a have installed laravel via composer.

However, in most of the tutorials people are using artisan commands in terminal to create migrations.

I always get the same error here even though I have already tried to download another php version and mcrypt and to set those things up in the terminal.

Is there maybe anything I have to do in MAMP?

I have already seen this question but I cant figure out which one of all these solutions fits my situation:

Laravel requires the Mcrypt PHP extension

I would be very glad if somebody could give me some ideas here.

Thanks.

Community
  • 1
  • 1
patrick
  • 881
  • 2
  • 9
  • 32

1 Answers1

2

You receiving Mcrypt not found error because your Mac terminal using system's PHP and unfortunately, Default PHP don't have the MyCrypt extension.

How to enable Mcrypt:

The easiest solution is, use the MAMP's PHP

How to use MAMP?

Simply edit ~/.profile (ie. open Terminal.app, type vim ~/.profile or nano ~/.profile) and add the following line to end of the file:

export PATH=/Applications/MAMP/bin/php/php5.x.x/bin/:$PATH Note that you should replace x.x in php5.x.x with the MAMP Pro PHP version.

My setting:

in your terminal:

nano /Users/anam/.bash_profile
            ^^^ your mac home directory

I have placed the following code to my .bash_profile:

export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH
Anam
  • 11,999
  • 9
  • 49
  • 63
  • Thank you very much. So am I supposed to add the line that starts with PATH... to the end of which file? – patrick Jan 01 '14 at 12:13
  • from `export PATH=/Applications/MAMP/bin/php/php5.x.x/bin/:$PATH` – Anam Jan 01 '14 at 12:24
  • i got that. Which command ends the process (from what is in the bottom line)? – patrick Jan 01 '14 at 13:30
  • After you save the file, close the terminal and reopen it and you good to go. – Anam Jan 01 '14 at 14:02
  • I am so sorry for being such a beginner, but I don't get how to safe it. I am very sorry. – patrick Jan 01 '14 at 14:07
  • In nano, to save a file hit ctr + X. If something needs to save Nano will ask you, do wants to save? Then type `y` and hit return. – Anam Jan 01 '14 at 14:13