Laravel - artisan command not working

£可爱£侵袭症+ 提交于 2019-12-13 05:12:31

问题


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


回答1:


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!



来源:https://stackoverflow.com/questions/18910502/laravel-artisan-command-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!