JPGraph-Need help configuring

hello stuart,

here is a screenshot of the unzipped folder, which is named/default name of wxgraphs and it is showing the path to my server, which I believe is /web/wxgraphs

http://img239.imageshack.us/img239/2554/sshot43ua4.jpg

my problem I believe is I am not entering exactly the correct path for either hostloc or jploc inside the config.php

do I need to change any of the actual other php files, like the temp_hum.php?

thanks, chris

this page: http://www.gateway2capecod.com/wxgraphs/wxgraphs_test.html …loads but no graphs showing

you did install the jpgraph-package from http://www.aditus.nu first, did you ?

hello pinto,

the package I downloaded was a zip file from broadstairs, and it was named “wxgraphs”…I then unzipped it and it created a folder named 'wxgraphs", which has all the php files inside it like:…temp_hum.php, graphsconfig.php, year_rain.php etc etc.

I then so far have uploaded the entire folder to my server, and when you go to this page:
http://www.gateway2capecod.com/wxgraphs/wxgraphs_test.html …the page displays but with no graphs visible.

I believe I need to enter the correct info on the hostloc and jploc area’s of the graphsconfig file, BUT dont know exactly what needs to be entered

if anyone can show a screenshot of their top 10 lines of their graphsconfig.php file to me, perhpas I can figure out my exact info to enter

this is really getting me aggravated…LOL

I have tried doing this , inside the grapghsconfig.php but it still doesnt work and shows error or syntax errors…i tried this, but no luck:

<?php // Obtain Basic Environment $WEBROOT = $_SERVER['DOCUMENT_ROOT']; //========================================== //where are your clientraw*-files and JPGraph relative to where this file is //note you should only need to change the jpgraph directory if you do not use standard names $hostloc = "${WEBROOT}/"; //must have trailing slash $jploc = "${/web}/wxgraphs/src/"; //must have trailing slash

after trying to edit the graphconfig.php with this:

<?php // Obtain Basic Environment $WEBROOT = $_SERVER['DOCUMENT_ROOT']; //========================================== //where are your clientraw*-files and JPGraph relative to where this file is //note you should only need to change the jpgraph directory if you do not use standard names $hostloc = "${WEBROOT}/"; //must have trailing slash $jploc = "${/web}/wxgraphs/src/"; //must have trailing slash I get this error when trying to view any of my Graph.php's: Parse error: syntax error, unexpected '/' in /virtual/users/e14837-15290/web/wxgraphs2/graphsconf.php on line 8

Well have you installed this package, cos without it nothing works!

Stuart

hello stuart,

when I click on the link for the package you are reffering to…I dont see anything to download there…if I click on the tab on that page that says “download”, there is some- 3 things…that can be downloaded from the download page

what do I need to download?

thanks, chris

fact: the package you installed works fine IF you first install jpgraph from the link I gave you
this package contains the libraries you need for broadstairs package to work

1 install jpgraph itself(download the version you need according to the php-version on your server)
2 install package from broadstairs

else you won’t be able to use those graphs

hello pinto,

thanks for your help…

how do I know which jpgraph php version to download?

I just downloaded the php4 jpgraph1.21b package, and it was a zip file…I unzipped it, and it created a folder named “jpgraph-1.21b”…it’s contents include a docs & src folder, and also a QPL a Read Me And a version file…what parts of this need to be uploaded to my server? and do they get placed into the wxgraphs folder on my server?

hopefully I have php4 and not php5,because if it is incorrect I will need to get the other download

thanks, chris

first you better check your php-version
put folowing code on your server and browse to it


<?php
echo phpversion();
?>

hello pinto,

I also just thought of that and it turns out I have php version 5.1.6 (I used the PHP_verify.php that came with my weather banner wxgraphics downloaded to verify this info)

see info here: http://www.gateway2capecod.com/PHP_verify.php

so I went back and downloaded the jpgrah version 2.2 from the site…

now I unzipped it, and did try to understand what the read me was talking about, but really dont understand it. My question is this…what part of the jpgraph version 2.2 contents do I need to upload to my server? where do I upload them to? do they go into the wxgraphs folder or stay within their own folder? or Am I totally way off with all of this?

just a bit confuzed and need some help…thanks, Chris

here is screenshot image of inside the jpgrah folder contents I have:
http://img158.imageshack.us/img158/3118/sshot50tl9.jpg

what I did was create a folder on my server and called it “jpgraph”, then put only the src folder in “jpgraph”
then browse to yourwebsite/jpgraph/src/Examples/testsuit.php to see if that works
IF it works you can install Stuart’s package

Hello pinto…did all that and it is working…see here:

http://www.gateway2capecod.com/jpgraph/src/Examples/testsuit.php

what do I need to do next?

what do I need to change in my graphconfig.php? which currently looks like this:

<?php // Obtain Basic Environment $WEBROOT = $_SERVER['DOCUMENT_ROOT']; //========================================== //where are your clientraw*-files and JPGraph relative to where this file is //note you should only need to change the jpgraph directory if you do not use standard names $hostloc = "${WEBROOT}/"; //must have trailing slash $jploc = "${WEBROOT}/jpgraph-1.20.5/src/"; //must have trailing slash thanks...we are getting closer to success...chris

not sure, I think

$jploc = “${WEBROOT}/jpgraph/src/”; //must have trailing slash

Ok,
I edited the line with $jploc = “${WEBROOT}/jpgraph/src/”; //must have trailing slash …and I believe that is correct.

but now when I go to my index page for all my broadstairs graphs here: http://www.gateway2capecod.com/wxgraphs/

I get this same error: for any of the graphs:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/X11R6/lib/X11/fonts/truetype/arialbd.ttf) is not within the allowed path(s): (/virtual/users/e14837:/tmp:/usr/lib/php) in /virtual/users/e14837-15290/web/jpgraph/src/jpgraph_ttf.inc.php on line 330
JpGraph Error Font file “/usr/X11R6/lib/X11/fonts/truetype/arialbd.ttf” is not readable or does not exist.

I edited the graphconfig file and replaced the default line of ARIAL text font to this:

//Font specifcations Not used yet!!!
//Use FF_FONT1 if you do not have the ARIAL font but be aware some graphs will not work because the default
//does not allow rotation of text.
//$aFontFamily = “FF_FONT1”;
//$aFontStyle = “FS_BOLD”;
//$aFontSize = 8; // This is the font size for main titles
//$aFontSize1 = 8; // This is font size for the axis (x & y)

But It appears I may need to get the Arial font installed, for the jpgrahs to work correctly

where do I down load the arial font from? shouldnt I have an arial font if I have newest windowsxp editions?

getting closer though…thanks chris

you don’t have ttf fonts on the server

this is not easy to explain for me, but I try

create a folder “ttf” in your jpgraph/src folder
upload arialbd.ttf to it you find it in windows/fonts/Arial bold (True Type)
make sure you rename it (no capitals here)it must be arialbd.ttf not ARIALBD.TTF

open jpg-config.inc.php

find
// DEFINE(“TTF_DIR”,“/usr/X11R6/lib/X11/fonts/truetype/”);
and uncomment that line
change the path to the hardpath to you ttf folder
something like
DEFINE(“TTF_DIR”,“/virtual/users/e14837-15290/web/jpgraph/ttf/”);

I hope I did not forget someting here

you find jpg-config.inc.php in the jpraph/src folder

and to find the correct path of your ttf folder put attachement(after unzipping it) in your ttf folder and browse to it

copy and paste that path and jpgraph must find your fonts


hardpath.zip (151 Bytes)

no luck on any of this…

dont understand why I can use the non arial font?

well I am stuck here:

when trying to view any of my wxgraphs, I get this same error message:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/X11R6/lib/X11/fonts/truetype/arialbd.ttf) is not within the allowed path(s): (/virtual/users/e14837:/tmp:/usr/lib/php) in /virtual/users/e14837-15290/web/jpgraph/src/jpgraph_ttf.inc.php on line 330
JpGraph Error Font file “/usr/X11R6/lib/X11/fonts/truetype/arialbd.ttf” is not readable or does not exist.

my grapghs index page is here:

http://www.gateway2capecod.com/wxgraphs/

thanks for the help pinto , but I can not get it working…maybe broadstairs has some answers on this

I must have forgotten something,don’t know what

well just to recap on everything I did so faR:

downloaded the jpgraph and checked that I have version 2.2 for php vers 5 support
then uploaded the examples to my server and they are working here:

http://www.gateway2capecod.com/jpgraph/src/Examples/testsuit.php

downloaded the wxgrapghs…and edited only this line inside the graphconfig.php to this:

//where are your clientraw*-files and JPGraph relative to where this file is
//note you should only need to change the jpgraph directory if you do not use standard names
$hostloc = “${WEBROOT}/”; //must have trailing slash
$jploc = “${WEBROOT}/jpgraph/src/”; //must have trailing slash

the wxgraph and jpgraph folders are both uploaded to my server

when going to my index page and trying to view any of the broadstairs graphs, I get the error about the font being misconfigured.

I made a new folder on the server, within the jpgraph/src folder and named ttf and added the arialbd.tff to it

some things I dont understand is why do the example graphs display and not the broadstairs grapghs?

shouldnt the broadstairs grapghs display at least the grapgh itself, even if the font is not avaliable? which would be a grapgh display without any text font’s? or do the broadstairs graph’s need the correct arial font even just to display the actual graph?

if the broadstairs graphs need the arial font, why wasnt it included as part of the package download, to make things easier?

well hopefully we cant figure this out and I can get it working, but for now I am stumped on what to do next

chris