【发布时间】:2013-01-03 08:58:41
【问题描述】:
我有一个这样的项目结构:
ProjectName/
src
test
TestClass.php
tests
TestTestClass.php
当我尝试对 tests/TestTestClass.php 执行 require_once '/ProjectName/src/test/TestClass.php'; 时,我从 PHP 中收到一条错误消息,指出:没有这样的文件或目录。
我已经检查了拼写,我已经检查了所有内容。我不能给它完整的/home/userName/bla/bla 路径,因为我需要把它交给其他人。
有什么想法吗?
【问题讨论】:
-
您使用的是绝对路径。
/ProjectName在你的绝对根目录中吗? -
您是否尝试过使用相对路径?例如
require_once '../src/test/TestClass.php'
标签: php phpunit require-once