Laravel-工匠命令不起作用 [英] Laravel - artisan command not working

查看:62
本文介绍了Laravel-工匠命令不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mac上开始使用laravel,并正在使用MAMP.我在laravel中使用`artisan'命令.

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

但这给了我这个错误

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.

我已经为PHP安装了mcrypt扩展.

I have installed the mcrypt extension for PHP.

brew install php53-mcrypt

这会给我一条消息,提示它已经安装:php53-mcrypt-5.3.26 already installed

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

推荐答案

在命令行中运行的PHP与通过Web服务器运行时的PHP不同,结果是常见

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)

关键在于:

  1. 确保正确的PHP二进制文件(由MAMP使用的二进制文件)在您的PATH中
  2. (不太可能)检查您的CLI运行的php.ini和加载的扩展名是否不同于您的网络服务器(Apache)运行的PHP(它们可能有所不同).

最后,请考虑使用 Vagrant 或其他

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!

这篇关于Laravel-工匠命令不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆