0

I am getting started with using laravel on Mac and am using MAMP. I am using the `artisan' command with laravel in php.

php artisan migrate:make create_users_table --table=users --create

But it is giving me this error

php artisan migrate:make create_users_table --table=users --create
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so, 9): image not found in Unknown on line 0
Laravel requires the Mcrypt PHP extension.

I have installed the mcrypt extension for PHP.

brew install php53-mcrypt

This gives me a message saying that it is already installed: php53-mcrypt-5.3.26 already installed

Ashish Agarwal
  • 14,555
  • 31
  • 86
  • 125

1 Answers1

2

PHP being different when run in the command line versus through your web server turns out to be a pretty common issue (note that those are three separate links with possible solutions :D)

The key point is to:

  1. make sure the correct PHP binary (the one used by MAMP) is in your PATH
  2. (less likely) to check to see if your CLI-run php.ini and loaded extensions is different from your web-server (apache)-run PHP (They can be potentially different).

Finally, please consider saving your time and some stress by using Vagrant or another VM provider, which gives you the ability to run a "real" web server on your computer without mucking up your Mac OS install!

Community
  • 1
  • 1
fideloper
  • 12,213
  • 1
  • 41
  • 38