<?php
// the line below is only needed if the include path is not set on php.ini
ini_set("include path",ini_get("include path").":/usr/lib/phpreports/");
include once "PHPReportMaker.php";
$oRpt = new PHPReportMaker();
$oRpt->setUser("taq");
$oRpt->setPassword("******");
$oRpt->setXML("sales.xml");
$oRpt->run();
?> 

解决方案 »

  1.   

    你那个文档改为我1楼回答的就没有语法错误了,ini set和int get不是函数,又不是字符串就有错误了,你应该是复制的时候丢失了数据,把“ini_set”和“ini_gei”变成了“ini set”和“ini gei”。
      

  2.   

    我用了你的代码后,又报
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\htdocs\test\sales.php on line 4
      

  3.   

    include once "PHPReportMaker.php"
    =>
    include_once "PHPReportMaker.php"
      

  4.   


    按照jakey9826自由火的改,我修改时,漏了,原因还是我2楼回答的:<?php
    // the line below is only needed if the include path is not set on php.ini
    ini_set("include path",ini_get("include path").":/usr/lib/phpreports/");
    include_once "PHPReportMaker.php";
    $oRpt = new PHPReportMaker();
    $oRpt->setUser("taq");
    $oRpt->setPassword("******");
    $oRpt->setXML("sales.xml");
    $oRpt->run();
    ?>
      

  5.   

    我知道了那个函数的问题
    不过我不太理解那个路径的问题Warning: include_once(PHPReportMaker.php) [function.include-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\test\sales.php on line 4Warning: include_once() [function.include]: Failed opening 'PHPReportMaker.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\test\sales.php on line 4Fatal error: Class 'PHPReportMaker' not found in C:\xampp\htdocs\test\sales.php on line 5请问我的路径该怎么设置?
      

  6.   

    ini_set("include path",ini_get("include path").":/usr/lib/phpreports/");
    加这个是将/usr/lib/phpreportsp这个路径加到include_path里,你是windows,当然没有这个路径了.或者在这里指明PHPReportMaker.php路径,这是首先.
    或者在include_path加,但不是建议,因为不知道这个文件里是不是还要包含其它的文件.
      

  7.   

    ini_set("include path",ini_get("include path").":/usr/lib/phpreports/");
    加这个是将/usr/lib/phpreportsp这个路径加到include_path里,你是windows,当然没有这个路径了.或者在这里指明PHPReportMaker.php路径,这是首先.
    或者在include_path加,但不是建议,因为不知道这个文件里是不是还要包含其它的文件.
      

  8.   

    你应该直接在include_once参数写PHPReportMaker.php所在的绝对路径或相对路径。