Page 1 of 1
Noob PHP Problems
Posted: Wed 23 Mar 2011 12:03 pm
by Krumlov
Hi Guys,
Am interested in getting some historical data on my website and my reading tells me I need some add ons specifically JPGRAPH. So I have gone through all the installation documents but the PHP files don't work properly.
If you look here you will see PHP5 and GD should all be working:
http://users.on.net/~gavin_n/weather/info.php
But if I try this nothing happens:
http://users.on.net/~gavin_n/weather/cu ... ource=view
And if I try this no images appear:
http://users.on.net/~gavin_n/weather/jp ... stsuit.php
Any ideas?

Re: Noob PHP Problems
Posted: Wed 23 Mar 2011 1:15 pm
by steve
That link works fine for me - it displays the contents of the cumuluswebtags.php file and shows that it's being processed and uploaded correctly.
That gives me a 404 - not found, so it's not a PHP problem, the file simply doesn't exist. Is that a file that you're supposed to upload yourself? I'm afraid I'm not really familiar with what you're trying to do so I'm not a lot of help! I'm sure someone who has done this already will be along soon...
Re: Noob PHP Problems
Posted: Wed 23 Mar 2011 9:28 pm
by Krumlov
Firstly as for the cumuluswebtags file perhaps it is a browser issue then. I just get:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY><PRE></PRE></BODY></HTML>
I have since moved things around by reading all the documentation but it still doesn't work. It looks to me that all of the examples are using a relative path to all the PHP files so nothing can be found. The files are now here so can you try again:
http://www.users.on.net/~gavin_n/jpgrap ... stsuit.php
Re: Noob PHP Problems
Posted: Wed 23 Mar 2011 10:43 pm
by beteljuice
The graphs themselves are failing because you haven't any fonts installed.
Re: Noob PHP Problems
Posted: Thu 24 Mar 2011 3:07 am
by Krumlov
beteljuice wrote:The graphs themselves are failing because you haven't any fonts installed.
Actually the fonts are installed but I think the webserver can't find the data because it isn't looking where everything is installed. I have this on my ISPs website and I don't have control over the php.ini file that the documentation is talking about where the PATHs are defined. Has anyone else installed this stuff?
Re: Noob PHP Problems
Posted: Thu 24 Mar 2011 3:32 am
by beteljuice
Your datafile and the graph call are working.
eg. Part of acbarex1.php
<?php // content="text/plain; charset=utf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');
$data1y=array(-8,8,9,3,5,6);
$data2y=array(18,2,1,7,5,4);
// Create the graph. These two calls are always required
$graph = new Graph(500,400);
$graph->SetScale("textlin");
.......
but the graph generation is failing because ......
Warning:
imageloadfont(/webspace/users.on.net/data/T8/42/T842581/jpgraph/Examples/jpgraph/fonts/FF_FONT0.gdf)
function.imageloadfont: failed to open stream: No such file or directory in /webspace/users.on.net/data/T8/42/T842581/jpgraph/Examples/jpgraph/gd_image.inc.php on line 91
and similar warnings for other fonts. through to line 95
Re: Noob PHP Problems
Posted: Thu 24 Mar 2011 4:49 am
by Krumlov
beteljuice wrote:
.......
but the graph generation is failing because ......
Warning:
imageloadfont(/webspace/users.on.net/data/T8/42/T842581/jpgraph/Examples/jpgraph/fonts/FF_FONT0.gdf)
function.imageloadfont: failed to open stream: No such file or directory in /webspace/users.on.net/data/T8/42/T842581/jpgraph/Examples/jpgraph/gd_image.inc.php on line 91
and similar warnings for other fonts. through to line 95
Yep that is because all of the jpgraph files are in "my" root level. So jpgraph.php is in /webspace/users.on.net/data/T8/42/T842581/jpgraph/ and the fonts are in /webspace/users.on.net/data/T8/42/T842581/jpgraph/fonts
Each of the examples seem to be using a relative path. That is, jpgraph/fonts which from the Examples directory translates to .../Examples/jpgraph/fonts
If I copy one of the examples to "my" root then it works (I think)
http://users.on.net/~gavin_n/ganttmonthyearex1.php
I am just trying to work out what others have done to get this to work because I can't be alone here. Can I?
