向我的网站添加 API 图形时出现的问题排查

发布于 2024-10-26 04:45:11 字数 3957 浏览 5 评论 0原文

我的 ChartDirector v.5 API 有问题,

我将代码拖放到我的网站中。

当我转到特定页面时..它显示一条错误消息:

加载 PHP 扩展的 ChartDirector 时出错

已尝试动态加载 ChartDirector,但没有成功。请参阅您的 ChartDirector for PHP 文档或单击此处了解如何解决该问题。

错误日志

Trying to load "phpchartdir530.dll" from the PHP extension directory "c:/wamp/bin/php/php5.3.5/ext/".
Fatal error: Call to undefined function dl() in C:\wamp\www\OrdiDepot\application\views\phpchartdir.php on line 44 
Call Stack: 0.0018 378216 
1. {main}() C:\wamp\www\OrdiDepot\index.php:0 0.0036 427824 
2. require_once('C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php') C:\wamp\www\OrdiDepot\index.php:115 0.0329 1386232 
3. call_user_func_array() C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php:236 0.0329 1386280 
4. ordiDepot->apropos() C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php:0 0.0344 1392432 
5. CI_Loader->view() C:\wamp\www\OrdiDepot\application\controllers\ordiDepot.php:64 0.0344 1393128 
6. CI_Loader->_ci_load() C:\wamp\www\OrdiDepot\system\libraries\Loader.php:307 0.0354 1452168 
7. include('C:\wamp\www\OrdiDepot\application\views\apropos.php') C:\wamp\www\OrdiDepot\system\libraries\Loader.php:677 0.0537 3934888 
8. require_once('C:\wamp\www\OrdiDepot\application\views\phpchartdir.php') C:\wamp\www\OrdiDepot\application\views\apropos.php:49 0.0538 3980304 
9. cdLoadDLL() C:\wamp\www\OrdiDepot\application\views\phpchartdir.php:174 

对于 require_once 文件..我把它放在与我的视图相同的目录中(我使用 MVC 模型)

这是我的代码:

<div class="center_content">
   <div class="center_title_bar">À propos</div>
     <div class="prod_box_big">
        <div class="top_prod_box_big"></div>
        <div class="center_prod_box_big">            
                 <div class="details_big_box">
                    <div class = "info_compagnie">
    L’entreprise OrdiDépôt Inc. est une PME de Montréal qui 
    a été créée en 2010. Elle œuvre dans le domaine de l’informatique 
    et le divertissement  PC.  OrdiDépôt Inc. est une compagnie de 
    vente de matériel dans ces domaines. Nous offrons :   pièces 
   d’ordinateurs, systèmes complets et Jeux PC.
</div>
<div class = "graphic">
<?php
    require_once('phpchartdir.php');

    # The data for the pie chart
    $data = array(25, 18, 15, 12, 8, 30, 35);

        # The labels for the pie chart
    $labels = array("Labor", "Licenses", "Taxes", "Legal", "Insurance", "Facilities",
                                "Production");

                            # Create a PieChart object of size 450 x 270 pixels
                            $c = new PieChart(450, 270);

                            # Set the center of the pie at (150, 100) and the radius to 80 pixels
                            $c->setPieSize(150, 135, 100);

                            # add a legend box where the top left corner is at (330, 50)
                            $c->addLegend(330, 60);

                            # modify the sector label format to show percentages only
                            $c->setLabelFormat("{percent}%");

                            # Set the pie data and the pie labels
                            $c->setData($data, $labels);

                            # Use rounded edge shading, with a 1 pixel white (FFFFFF) border
                            $c->setSectorStyle(RoundedEdgeShading, 0xffffff, 1);

                            # Output the chart
                            header("Content-type: image/png");
                            print($c->makeChart2(PNG));
                        ?>
                    </div>
                 </div>                        
        </div>
       <div class="bottom_prod_box_big"></div>                                
     </div>
   </div>     <!-- end of center content -->  

感谢大家

i have a problem with the ChartDirector v.5 API

I drag and drop the code in my website.

when i go to the specific page.. it display an error message :

Error Loading ChartDirector for PHP Extension

An attempt has been made to dynamically load ChartDirector, but it was not successful. Please refer to your ChartDirector for PHP documentation or click here for how to resolve the problem.

Error Log

Trying to load "phpchartdir530.dll" from the PHP extension directory "c:/wamp/bin/php/php5.3.5/ext/".
Fatal error: Call to undefined function dl() in C:\wamp\www\OrdiDepot\application\views\phpchartdir.php on line 44 
Call Stack: 0.0018 378216 
1. {main}() C:\wamp\www\OrdiDepot\index.php:0 0.0036 427824 
2. require_once('C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php') C:\wamp\www\OrdiDepot\index.php:115 0.0329 1386232 
3. call_user_func_array() C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php:236 0.0329 1386280 
4. ordiDepot->apropos() C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php:0 0.0344 1392432 
5. CI_Loader->view() C:\wamp\www\OrdiDepot\application\controllers\ordiDepot.php:64 0.0344 1393128 
6. CI_Loader->_ci_load() C:\wamp\www\OrdiDepot\system\libraries\Loader.php:307 0.0354 1452168 
7. include('C:\wamp\www\OrdiDepot\application\views\apropos.php') C:\wamp\www\OrdiDepot\system\libraries\Loader.php:677 0.0537 3934888 
8. require_once('C:\wamp\www\OrdiDepot\application\views\phpchartdir.php') C:\wamp\www\OrdiDepot\application\views\apropos.php:49 0.0538 3980304 
9. cdLoadDLL() C:\wamp\www\OrdiDepot\application\views\phpchartdir.php:174 

For the require_once file.. i put it in the same directory than my view (I use a MVC Model)

Here's my code:

<div class="center_content">
   <div class="center_title_bar">À propos</div>
     <div class="prod_box_big">
        <div class="top_prod_box_big"></div>
        <div class="center_prod_box_big">            
                 <div class="details_big_box">
                    <div class = "info_compagnie">
    L’entreprise OrdiDépôt Inc. est une PME de Montréal qui 
    a été créée en 2010. Elle œuvre dans le domaine de l’informatique 
    et le divertissement  PC.  OrdiDépôt Inc. est une compagnie de 
    vente de matériel dans ces domaines. Nous offrons :   pièces 
   d’ordinateurs, systèmes complets et Jeux PC.
</div>
<div class = "graphic">
<?php
    require_once('phpchartdir.php');

    # The data for the pie chart
    $data = array(25, 18, 15, 12, 8, 30, 35);

        # The labels for the pie chart
    $labels = array("Labor", "Licenses", "Taxes", "Legal", "Insurance", "Facilities",
                                "Production");

                            # Create a PieChart object of size 450 x 270 pixels
                            $c = new PieChart(450, 270);

                            # Set the center of the pie at (150, 100) and the radius to 80 pixels
                            $c->setPieSize(150, 135, 100);

                            # add a legend box where the top left corner is at (330, 50)
                            $c->addLegend(330, 60);

                            # modify the sector label format to show percentages only
                            $c->setLabelFormat("{percent}%");

                            # Set the pie data and the pie labels
                            $c->setData($data, $labels);

                            # Use rounded edge shading, with a 1 pixel white (FFFFFF) border
                            $c->setSectorStyle(RoundedEdgeShading, 0xffffff, 1);

                            # Output the chart
                            header("Content-type: image/png");
                            print($c->makeChart2(PNG));
                        ?>
                    </div>
                 </div>                        
        </div>
       <div class="bottom_prod_box_big"></div>                                
     </div>
   </div>     <!-- end of center content -->  

Thanks to all

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撑一把青伞 2024-11-02 04:45:11

看起来代码正在尝试调用 dl 在运行时执行扩展的动态加载。自 5.3 起,dl 已从 PHP 中删除

如果您需要加载扩展,则需要修改 php.ini 文件。在 php.ini 文件中查找扩展列表,并将其添加到其中。看起来ChartDirector 有这样做的基本说明

您可能希望考虑其他产品。 ChartDirector 安装文档 似乎是为 PHP4 编写的,这通常是一个坏兆头:

Windows 上的 ChartDirector for PHP 至少需要 PHP 版本 4.0.4pl1,并且已经过测试,最高可达 PHP 版本 4.3.4(截至本文档发布之日的最新 PHP 版本)。

It looks like the code is trying to call dl to perform dynamic loading of an extension at runtime. dl has been removed from PHP as of 5.3.

If you need to load an extension, you will need to modify your php.ini file. Look for the list of extensions in your php.ini file, and add it there. It looks like ChartDirector has basic instructions for doing so.

You may wish to consider other products. The ChartDirector installation documents appear to be written for PHP4, and that's generally a bad sign:

ChartDirector for PHP on Windows requires at least PHP versions 4.0.4pl1, and has been tested up to PHP Ver 4.3.4 (the latest PHP release as of the date of this document).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文