2

I install laravel by running:

laravel new testing

And it responds with:

Application ready! Build something amazing.

Yet when I visit public/index.php, it presents an empty page that says:

Mcrypt PHP extension required.

When I run php -m it does not list Mcrypt.

I tried installing it with composer, by running:

composer create-project laravel/laravel laravel_composer --prefer-dist

And it resulted with the following:

Writing lock file
Generating autoload files
Mcrypt PHP extension required.
Script php artisan clear-compiled handling the post-install-cmd event returned with an error



[RuntimeException]  
Error Output:

There is nothing additional after "Error Output:"

Cœur
  • 37,241
  • 25
  • 195
  • 267
ChinDave
  • 37
  • 3
  • It probably requires the mcrypt library to be installed ;) Please provide more info, which PHP executable are you using? The one which comes with OS X, or maybe MAMP or something else? – Ronni Egeriis Persson Apr 19 '14 at 23:12
  • Recompile PHP with mcrypt. – Ohgodwhy Apr 19 '14 at 23:13
  • @RonniEgeriis I am using the default install location of php. '/usr/bin/php' – ChinDave Apr 19 '14 at 23:16
  • possible duplicate of [Laravel requires the Mcrypt PHP extension](http://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension) – totymedli Apr 19 '14 at 23:44
  • 1
    I would recommend using MAMP and point your default `php` symlink to the php binary found in your MAMP installation. This is by far the easiest solution. You can also call the php binary directly, e.g. `/Applications/MAMP/bin/php/php5.4.10/bin/php script.php` – Ronni Egeriis Persson Apr 22 '14 at 13:07
  • Thanks for this, I had totally missed the step of installing php5-mcrypt. – Robin Layfield Aug 15 '14 at 00:38
  • 1
    @ChinDave You should post an answer and accept it so that this question stops appearing un unanswered lists. – Ben Swinburne Nov 25 '14 at 12:27

1 Answers1

0

Solution by OP.

I resolved the issue by updating to php55 and php55-mcrypt using homebrew.

I had an issue with conflicting php versions post-install, which I resolved by editing the apache2 httpd.conf property LoadModule php5_module. By uncommenting it and changing the default file path to look for local/php5-5.5.11-20140408-141340/libphp5.so.

Mcrypt was no longer an issue and apache was locating the correct php. The last thing I had to do was change the permissions of laravel_project/app/storage using chmod -R o+w storage

Cœur
  • 37,241
  • 25
  • 195
  • 267