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
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).
精彩评论