How to setup jpgraphs and wxgraphs

/===============================================================================================
date_default_timezone_set(‘America/Los_Angeles’); // Set your timezone
//$hostloc needs to be updated to point to where your clientraw*-files are located if not in the root directory
$hostloc = “{$WEBROOT}/sgmgh/”; //if your files are in a sub-directory you must add trailing slash
//note you should only need to change the jpgraph directory if you do not use standard names
$jploc = " {$WEBROOT}/jpgraph 4.4.2/src/"; //must have trailing slash

//Set this variable to either 12 or 24 depending on whether you run Weather Display in 12 or 24 hour mode
$hourmode = “24”;

The directory wxgraphs is usually a subdirectory of httpdocs, just like jpgraph-4.4.2. Upload the package to httpdocs.

And I see, as @hcorrin says, you have used a space instead of a hyphen in naming the directory jpgraph 4.4.2.

Question: where is /sgmgh?

Oh ok, I’ll fix those 2 things and see what happens
thanks again

/sgmgh is in the httpdocs folder for the steel guages

new location http://www.docmarvweather.com/wxgraphs/wxgraphs_test.html

new graphconf setting screen shot
//===============================================================================================
date_default_timezone_set(‘America/Los_Angeles’); // Set your timezone
//$hostloc needs to be updated to point to where your clientraw*-files are located if not in the root directory
$hostloc = “{$WEBROOT}/sgmgh/”; //if your files are in a sub-directory you must add trailing slash
//note you should only need to change the jpgraph directory if you do not use standard names
$jploc = " {$WEBROOT}/jpgraph-4.4.2/src/"; //must have trailing slash

//Set this variable to either 12 or 24 depending on whether you run Weather Display in 12 or 24 hour mode
$hourmode = “24”;

What does this mean?

[13-May-2024 17:00:06 America/Los_Angeles] PHP Warning: file_exists(): open_basedir restriction in effect. File( G:\PleskVhosts\docmarvweather.com\httpdocs/jpgraph-4.4.2/src/jpgraph.php) is not within the allowed path(s): (G:/PleskVhosts/docmarvweather.com;C:\Windows\Temp) in G:\PleskVhosts\docmarvweather.com\httpdocs\wxgraphs\rain_today.php on line 5

Your config and folder structure now look ok
The error is caused by the open_basedir setting you have, you need to talk to your hosting about that ie control panel setting or php.ini file but if shared hosting you probably won’t have access

Hi
the way i got mine to work was to make the directory called wxgraphs, then put the src directory into the wxgraphs directory and point it all to there.

WX Graphs test page (hytheweather.co.uk)

Cool swright1957, can you show me a screenshot of your graphconf file?

So just drag the src folder into the wxgraph foler

Here is a screenshot of the directory

Here is a screenshot of the graphconf.

Any questions please ask…

Hey, thanks for the help,
I tried what swright1957 suggested and still didn’t want work.

so I called support at Godaddy and he said Windows “plesk” has issues handling PHP. He said 7.4 should work


I changed the "open_basedir " option to “none” and now I’m not getting those errors any more but still not seeing any graphs

I noticed the PHP is using “iis”
in the readme file it said he was not going to help with “iis”

// Graphs Package V4.1 14 October 2022

Please note that I am no longer supplying files for use with IIS. If anyone still uses IIS then it will be up to the user to
make any required changes. Also I am not supplying any language versions other than English.
Maybe that’s the problem??
Thanks again everyone

Hi
send me a copy of your graphconf.php and i will look at it for you.

Yeah, in earlier versions there was a graphsconf_IIS.php too. . . but IIRC the main problem was that IIS doesn’t like + in filenames so @broadstairs provided graph files called, e.g., temp_dew_hum_24hr.php as well as temp+dew+hum_24hr.php

Yes I decided against supporting IIS as it was too much trouble and I was not going to install it to test. I only run Linux boxes now and no longer use WD either. The graphs are free and if anyone wants to modify them to support IIS go ahead.

Stuart

Hey Stuart, thanks for helping
When we adjust the “historical-annual-rain” PHP do we need to put the data in as mm or inches?
thanks again for the help

Must admit I’d never heard of Plesk before. . . hence the mixture of slashes and backslashes that was worrying me :wink:

I just looked at the code and I think you have to enter the values in mm and it looks like if you have ‘$rain_conv = 0.0394’ in the graphsconf file then it will convert the mm to in for display. So all I can say is try it and see if I’m right!

Stuart

Godaddy support said cpanel handles php a lot better so someday I’ll migrate to that and comes with free https, but costs about $200 to move everything

From the Plesk PHP Settings you show it looks like you might have to try {$DOCROOT} or {$WEBSPACEROOT} for {$WEBROOT} in graphsconf.php

(Clutching at straws, here :confused:)

Hey Thanks
here’s the GoDaddy choices

I see several &WEBROOT spots in the graphsconf file?

<?php
// Graphs Package V3.1 5th April 2024
error_reporting(E_ALL);
// Obtain Basic Environment
// in APACHE servers it is always defined
if ( ! isset($_SERVER[‘DOCUMENT_ROOT’] ) ) {
$path_trans = str_replace( ‘\\’, ‘/’, $_SERVER[‘PATH_TRANSLATED’]);
$WEBROOT = substr($path_trans, 0, 0-strlen($_SERVER[‘PHP_SELF’]) );
}
else {
$WEBROOT = $_SERVER[‘DOCUMENT_ROOT’];
}
//===============================================================================================
//PLEASE UPDATE ALL THE VARIABLES IN THIS SECTION BELOW TO YOU REQUIRED VALUES
//===============================================================================================
date_default_timezone_set(‘America/Los_Angeles’); // Set your timezone
//$hostloc needs to be updated to point to where your clientraw
-files are located if not in the root directory
$hostloc = “{$WEBROOT}/”; //if your files are in a sub-directory you must add trailing slash
//note you should only need to change the jpgraph directory if you do not use standard names
$jploc = " {$WEBROOT}/jpgraph/src/"; //must have trailing slash
*

Don’t worry about the definition at the beginning because you maybe don’t need $WEBROOT at all. Just try changing $hostloc and $jploc.

I told you I’m clutching at straws :wink:

Hey thanks for the help,
Im getting this error now

[18-May-2024 11:27:12 America/Los_Angeles] PHP Notice: Undefined variable: DOCROOT in G:\PleskVhosts\docmarvweather.com\httpdocs\wxgraphs\graphsconf.php on line 18
[18-May-2024 11:27:12 America/Los_Angeles] PHP Notice: Undefined variable: DOCROOT in G:\PleskVhosts\docmarvweather.com\httpdocs\wxgraphs\graphsconf.php on line 20

Try {$WEBSPACEROOT}. . . and then I’m out of ideas :slightly_frowning_face:

Maybe you have to define the variable after all. . . hope someone can help.