I have all the wxgraphs inside of saratoga running fine except one. The year_rain_inc_avg.php wont run. One problem i found and fixed in some of the other files was that the tag for avgrain(this or that) is avrain, without the g. One trouble shooting tactic i have used is to run the php directly and examine the elements for where the issue is. However, all i get from year_rain_inc_avg.php file is an http 500 error and, for the life of me, i cannot figure out the problem.
Any suggestions or clues would be appreciated. WX Graphs
Thanks,
Jim
Maybe nothing, but line 14 doesn’t look right:
$clientrawdaily = get_raw ("${hostloc}clientrawdaily.txt");//for this graph we only need the values from this file
Looking at lines 10 and 11, should it read:
$clientrawdaily = get_raw ($hostloc."clientrawdaily.txt");
or even just
$clientrawdaily = get_raw ("../clientrawdaily.txt");
?
But I’m no expert, as you know. . . 
Interesting. The only iteration which changed things was
$clientrawdaily = get_raw (“…/clientrawdaily.txt”);
which gave me
instead of an http 500 error.
But that gives me something to keep loooking at.
Thanks.
J
Are you uploading all four clientraw*.txt files?
yup, confirmed all 4 to be present:
https://altlaw.com/clientrawdaily.txt
J
Much more strange, that same line is used in a bunch of the other graph files, but this is the only one that can’t find it or generates a 500 error.
J
Ah HA! That’s not the problem. I set the line back as it was and added after it
$string = "Unable to find some files";
create_image1($string,"Hi there");
exit;
and got a proper error message. So, its getting back from getting the file. The problem is further down.
J
I did wonder if that was the case. . . Sorry!
I don’t use the latest version of wxgraphs. . .
Not a problem, i appreciate the help. The problem is between lines 168 and 183. If i comment out those lines, i get a graph. The average data is screwy, but i get a graph.
Edit:
More specifically, on line 171 the value of $bar_rain is the problem.
J
$bar_rain is set at line 164 of graphsconf.php. . .
I am getting closer. Adding and substracting comments, its the eval() function on lines 175 and 182. Uncomment all except either of those two lines and it works. Now to trace down the eval function.
Edit: I cannot find an eval function in any of the included files. Still checking the files included by the other included files.
J
It’s a PHP function: see How to setup jpgraphs and wxgraphs - #476 by broadstairs
But I would have thought other graphs use eval() too 
and i see it further down the file, without issue. Well, at least its sufficiently found to know of the problem, but comparing the data to what’s in the two graphs just above it, i gotta wonder how it shows anything different than what’s already shown.

J
The eval command is used in the two year rain graphs which do work. The issue is probably the target of the eval command and not the eval per se. The way eval works is that the target is executed by php instead of the eval itself if you see what I mean. Try changing the target to $bsetv and see if that works (it is used in the two year graphs which do work) and if it works then the issue is with $bsetv1 and $bsetv2 themselves and their syntax.
Stuart
Thank you Stuart. I now understand the eval command better and, yes, it must be the targets. I changed both to $bsetv and i am sorry to report, no dice. Doesn’t work with those lines included.
Jim
That’s very strange since that eval is the same as that used in the two graphs that work!
Stuart
Do you have a local web server installed on your PC? If so does the graph work locally?
Also what version of JPGraph, PHP and Webserver is it running on on your web host?
Have you tried uploading just that graph file again in case it got corrupted?
Otherwise I can only think that there is an issue with the graph file itself since the other two graphs for the year values work and they call the eval with a parameter of $bsetv. So there has to be something wrong with the file, make sure there are no hidden characters in the data (some editors allow highlighting these hidden values like nulls etc).
Stuart
No local web server, I use Hostinger, which has always been good to me. JPGraph is 4.4.2, PHP is 8.2. I can’t find any clue as to what server they run. Yes, i have reloaded the script, i can’t find any flaw in the file, but i am not 100% any of my editors show hidden characters. My clientrawdaily.txt looks fresh and healthy.
I also see where that command is in use elsewhere without a problem.
Thanks for your suggestions, something will pop up and explain it.
Jim
Apparently Hostinger use Litespeed as their web server. As a 500 is a server error ask them for help and explain that the apparent failure is actually working in another 2 scripts. I only host with companies who use Apache 
Stuart
They may have changed since I last used them but they used to only use LiteSpeed on WordPress servers.