【发布时间】:2011-04-21 05:45:13
【问题描述】:
嗨,
我尝试通过终端运行文件,但收到类似“包含路径不正确”的错误
例如,我在以下文件夹中有一个“test.php”
/home/sekar/test/file.php
在 php 文件中,我包含了一个文件“head.php”,该文件位于
/home/sekar/test/includes/head.php
head.php 包含一个名为 cls.php 的类文件,位于类文件夹中,
/home/sekar/test/classes/cls.php
我在终端尝试过这样,
php /home/sekar/test/file.php
为了更清楚地查看这三个文件的@内容,
文件.php
<?php
include_once "./test/includes/head.php";
?>
head.php
<?php
include_once "./test/classes/cls.php";
?>
cls.php
<?php
echo "this is from cls file";
?>
谁能帮我解决这个问题?谢谢!
【问题讨论】: