Laravel:仅在使用phpunit时缺少mcrypt扩展 [英] Laravel: Lacking mcrypt extension only when using phpunit

查看:67
本文介绍了Laravel:仅在使用phpunit时缺少mcrypt扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下问题-在Laravel 4安装文件夹中使用phpunit时,出现以下错误:

I have a following problem - when using phpunit in my Laravel 4 installation folder I get a following error:

Laravel requires the Mcrypt PHP extension.

但是,当我使用artisan命令时,它不会出现.我知道问题一定是由phpunit加载了另一个php.ini而不是zshconfig中设置的php.ini引起的.

However it does not appear when I'm using the artisan command. I know that the issue must be caused by phpunit loading another php.ini than the one set in my zshconfig.

不幸的是,我不知道如何强制phpunit使用正确的.

Unfortunately I don't know how to force phpunit to use the correct one.

我的.zshconfig看起来像这样:

My .zshconfig looks like this:

# Customize to your needs...
export PATH=:/Applications/MAMP/Library/bin/:/Users/jacekbandura/pear/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin/:/Users/jacekbandura/nasm

export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

我正在使用OS X 10.8.4和MAMP.

I'm using OS X 10.8.4 and MAMP.

有人解决过这个问题吗? 在此先感谢:)

Has anyone solved this problem before? Thanks in advance :)

推荐答案

以下是PHPUnit的一些安装说明和一篇文章.您是否通过composer安装了phpunit?还是您以其他方式安装了它?

Here are some install notes from PHPUnit and an article. Did you install phpunit via composer? Or did you install it another way?

以下是一些安装说明,希望其中一个与您的用例相符.

Here are some install directions, hopefully one matches your use case.

PhpUnit文档指向编辑phpunit文件并将路径设置为直接使用PHP二进制文件

PhpUnit docs point towards editing a phpunit file and setting the path to the php binary directly

本文指向通过PECL安装PhpUnit并显示了使用setp更改将要使用的PHP可执行文件

This article points towards installing PhpUnit with PECL and shows taking a setp to change the PHP executable you'll be using

此SO答案指向使用Composer ,但设置一些特定的配置

This SO answer points towards using Composer, but setting some specific config

这篇关于Laravel:仅在使用phpunit时缺少mcrypt扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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