|
split/explode function acts strange and cannot generate graph png |
Posted by Anthony Man on Aug-24-2011 17:05 |
|
Dear all:
The following codes works under ubuntu 10.10 with PHP 5.3.3-1 but it won't work on
Fedora 14 with PHP 5.3.6-1
trendline.php
=========
#passing httpParam to trendline_graph.php
...
$httpParam = sprintf("reportdate=%s&avgtime=%s", join(",", $reportdate), join(",",
$avgtime));
...
<p><img src="trendline_graph.php?<?php echo $httpParam?>">
...
trendline_graph.php
===============
# split up httpParam string into array
...
$labels = split(",",$_GET["reportdate"]);
$data = split(",",$_GET["avgtime"]);
...
#plot the graph
$labelsObj = $c->xAxis->setLabels($labels);
$labelsObj->setFontAngle(90);
$lineLayer = $c->addLineLayer();
$dataSetObj = $lineLayer->addDataSet($data, 0xcc9966, "Bluetooth Device");
$dataSetObj->setDataSymbol(SquareSymbol, 7);
$lineLayer->setLineWidth(2);
...
Under Ubuntu 10.10 with PHP 5.3.3-1, the split/explode function works and both $labels +
$data array got all the httpParam. However, when I'm using the same php file (same
coding) under Fedora 14 with PHP 5.3.6-1. It just won't generate the graph png file.
At this point, a strange thing happened. If I only passing 2 variables onto $labels and also
$data, the graph will generate. But anything more than 2 it won't generate the graph png
file.
I'm wondering is this problem was caused by PHP or else? |
Re: split/explode function acts strange and cannot generate graph png |
Posted by Peter Kwan on Aug-25-2011 03:11 |
|
Hi Anthony,
If a chart is not generated, would you mind to inform me what do you see on your web page? Is there any error message? If you see a broken image symbol (a red X) instead of a chart image, please go into the broken image symbol and inform me what is the error message. See:
http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_faq&thread=1117817200
Note that in order to display error messages, your PHP must be configured to allow error messages to be displayed on the browser. (In some PHP installations, the "php.ini" is configured not to display error message on the browser to avoid the users from seeing error messages.) Otherwise, you would need to retrieve the error message from the error log file.
Regards
Peter Kwan |
Re: split/explode function acts strange and cannot generate graph png |
Posted by Anthony Man on Aug-25-2011 10:45 |
|
Peter Kwan wrote:
Hi Anthony,
If a chart is not generated, would you mind to inform me what do you see on your web page? Is there any error message? If you see a broken image symbol (a red X) instead of a chart image, please go into the broken image symbol and inform me what is the error message. See:
http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_faq&thread=1117817200
Note that in order to display error messages, your PHP must be configured to allow error messages to be displayed on the browser. (In some PHP installations, the "php.ini" is configured not to display error message on the browser to avoid the users from seeing error messages.) Otherwise, you would need to retrieve the error message from the error log file.
Regards
Peter Kwan
Dear Peter:
After a long night researching, I finally found out what's actually going on inside Fedora 14. There's a module named mod_security which will enable by apache2. It blocks out the access within each directory or even the whole domain. Either you can disable the module through httpd.conf or rewrite some .htaccess to disable individually.
Thanks for your kindly reply.
Anthony |
|