【问题标题】:How to install phpChart lite library?如何安装 phpChart lite 库?
【发布时间】:2014-11-20 02:25:28
【问题描述】:

我正在使用 LAMPP 运行 Ubuntu,但我不太了解如何设置库。当我运行一个示例时,我得到了这个错误:

警告:require_once(/opt/lampp/htdocs//phpChart_Lite//conf.php):无法打开流:/opt/lampp/htdocs/simulacion_tecnodi/phpChart_Lite/server/cls_conf 中不存在存档或目录.php(1) : eval()'d 代码在第 1 行

致命错误:require_once():在 /opt/lampp 中打开所需的 '/opt/lampp/htdocs//phpChart_Lite//conf.php' (include_path='.:/opt/lampp/lib/php') 失败/htdocs/simulacion_tecnodi/phpChart_Lite/server/cls_conf.php(1):第 1 行的 eval() 代码

示例代码:

<?php
require_once("../conf.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>phpChart - Bar Test</title>
</head>
    <body>
    <div><span> </span><span id="info1b"></span></div>

<?php
$s1 = array(2, 6, 7, 10);
$ticks = array('a', 'b', 'c', 'd');

$pc = new C_PhpChartX(array($s1),'chart1');
$pc->add_plugins(array('highlighter','pointLabels'));
$pc->set_animate(true);
$pc->set_series_default(array(
    'renderer'=>'plugin::BarRenderer',
    'pointLabels'=> array('show'=>true)));
$pc->set_axes(array(
     'xaxis'=>array(
        'renderer'=>'plugin::CategoryAxisRenderer',
        'ticks'=>$ticks)
));
$pc->set_highlighter(array('show'=>false));
$pc->bind_js('jqplotDataClick',array(
    'series'=>'seriesIndex',
    'point'=>'pointIndex',
    'data'=>'data'));
$pc->draw(400,300);
?>
</body>
</html>

这里是conf.php文件代码:

<?php
define('SCRIPTPATH','/phpChart_Lite/');
define('DEBUG', true);
/******** DO NOT MODIFY ***********/
require_once('phpChart.php');     
/**********************************/
?>

【问题讨论】:

  • 请向我们展示您的代码!这是哪方面的问题
  • 先检查你是否对文件有足够的权限!然后检查它是否在正确的目录中!
  • 权限没问题我检查了
  • 也在正确的目录中吗?同时显示配置文件中的代码!
  • 好吧,这里是路径:opt/lampp/htdocs/xxxxx/phpChart_Lite/examples/bar_test.php 和 conf.php 路径:/opt/lampp/htdocs/xxxxx/phpChart_Lite/conf。 php

标签: php charts


【解决方案1】:

文件的压缩方式会导致创建多个“phpChart_Lite”文件夹。在 php.conf 文件的第 2 行,确保路径是这样的:

define('SCRIPTPATH','[YOUR PATH HERE]/phpChart_Lite/phpChart_Lite');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-18
    • 2012-08-26
    • 1970-01-01
    • 1970-01-01
    • 2017-04-26
    • 1970-01-01
    • 2020-07-21
    相关资源
    最近更新 更多