【发布时间】: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