Ashish Agarwal
Ashish Agarwal

Reputation: 14925

Laravel - artisan command not working

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

Upvotes: 0

Views: 6635

Answers (1)

fideloper
fideloper

Reputation: 12293

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!

Upvotes: 3

Related Questions