JpGraph Error General PHP error : include(): Failed opening


JpGraph Error General PHP error : include(): Failed opening 'src/jpgraph.php' for inclusion (include_path='.;D:xamppphpPEAR')

我想做一个包含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);

如果你使用../,它将返回一个文件夹