我想做一个包含jpgraph.php到report .php。报告的路径为:
我的代码是:D: ' xampp '根模块' web2project-master ' ' ' ' reporte.php报道jpgraph的路径为:D: ' xampp模块'根' web2project-master ' ' lib ' jpgraph ' src ' jpgraph.php
$file = ((dirname(__FILE__)))."'..'..'..'lib'jpgraph'src'jpgraph.php";
include_once($file);
我得到这个消息:
JpGraph Error一般PHP错误:include(): Failed open'src/jpg .php'用于包含(include_path='.;D:'xampp'php'PEAR').
我已经尝试了其他问题的解决方案,但我不知道如何使它们适应我的目录。如何修复此错误?提前感谢大家的帮助
如果您的pgraph.php
在根文件夹。(检查下面的文件结构)
index.php
lib
jpgraph
src
jpgraph.php
所以index.php
你必须使用
$file = './lib/jpgraph/src/jpgraph.php";
include_once($file);
如果你使用
../
,它将返回一个文件夹