【问题标题】:Using PHPUnit with CakePHP on IIS 7 over Windows在 Windows 上的 IIS 7 上使用 PHPUnit 和 CakePHP
【发布时间】:2013-11-21 22:18:05
【问题描述】:

我在尝试使 PHPUnit 在 IIS 7 和 Windows 7 上工作时遇到了麻烦。 尝试测试访问 http://localhost/your_app/test.php as pointed in the documentation 是否有效时出现此错误:

缺少控制器

错误:无法找到 Test.php&debug=1Controller。错误:创建 文件中的类 Test.php&debug=1Controller 下面: app\Controller\Test.php&debug=1Controller.php

}

注意:如果要自定义此错误消息,请创建 app\View\Errors\missing_controller.ctp 堆栈跟踪 APP\webroot\index.php 第 92 行 → Dispatcher->dispatch(CakeRequest, CakeResponse) ROOT\index.php 第 42 行 → 要求(字符串)

我一直在查看this other topic,但他的解决方案对我不起作用。

我已经使用以下命令安装了 Pear:

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install phpunit/PHPUnit-3.6.4

而且好像已经安装成功了:

我已编辑php.ini,并将pear 目录添加到include_path

; Windows: "\path1;\path2"
include_path = ".;c:\php\pear"

我在 IIS 7 上的重写规则如下(我只是从 .htaccess 文件将它们导入到 IIS 中):

这似乎是一个重写规则问题,因为它似乎在寻找不应该的控制器。

关于如何解决这个问题的任何想法? 谢谢。

【问题讨论】:

    标签: cakephp iis-7 phpunit cakephp-2.2


    【解决方案1】:

    我找到了解决办法。

    我不得不在 IIS 7 上禁用“URL 重写”的最后 2 条规则,然后访问以下 URL: http://localhost/cakephp/app/webroot/test.php

    【讨论】:

      猜你喜欢
      • 2012-06-17
      • 2014-04-16
      • 2011-10-03
      • 1970-01-01
      • 1970-01-01
      • 2011-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多