I’m currently migrating from PHP 7.4 to PHP 8+ and need help with the “alternative” ajax-dashboard. script originally published by Scott. If you are utilizing a version of the “alternative” ajax-dashboard and have moved to PHP 8+ …
What version of the ajax-version are you running?
2_What changes did you make to transition to the PHP 8+ version?
My current dashboard has had many customized additions and any assistance that you might be able to offer would be greatly appreciated.
For an older, heavily modified ajax-dashboard.php, the key things to modify are likely:
replace all ${variablename} with {$variablename}
replace all split(...) with explode(...)
there are multiple variables that had null string instead of null arrays. Check the error message and change $variable =''; to $variable = array(); for those variables so used, change if($variable == '') to if(!isset($variable[0])
some variables weren’t initialized with a value before being used… insert $variable = ''; for strings and $variable = array(); for arrays.
But the best advice… start with the current 6.95h version and do your mods there. Be sure to replace the four other PHP support scripts in the .zip too – they all work with PHP 8+.
Good luck.
I’m not sure about the JavaScript – I think there may be some updates from Scott’s version. The config file likewise may have some changes built-in, so I’d merge your settings from old->new and upload the new one.
With my version 6.95h I’m using Version 6.92d 14-May-2021 of AltAjaxDashboardConfig6.php . I think it needed very little editing.
With ajaxWDwx3.js I’m using Version 9.20 - 18-Feb-2023.
Other than the changes I made to the dashboard it didn’t need any editing.
Tom
Ken I’ve made significant progress migrating to PHP 8.2 with the professional help of Steve Fitzgerald but I have one remaining issue. My ajax client raw real time 5 second updates are not working. As I have a very customized site the SITE pointer in “Settings-weather.php” is $SITE[‘test-ajaxDashboard’] = ‘./test-ajax-dashboard-sjf2.php’; Where do I have to make changes to activate the real time ajax updates?
It is correct and the “clientraw.txt” file is uploading and updating on the server. The issue is that the auto real time (every 5 second refresh) isn’t active.
and it may enable ajaxWDwx3.js to work correctly.
BTW… changing $SITE[‘ajaxDashboard’] to $SITE[‘test-ajaxDashboard’] is not recommended… the site variable name is used to determine which dashboard to load in wxindex.php/index.php. It should read
Ken, I am experiencing a situation on my new PHP 8.2 website where my site crashes every couple of hours. Repetitive errors are being generated in the “error.log” on DreanHost’s server. One of the errors is as follows and appears on line 39,41,43,45,47,49,and 51 of the “clientraw-parser.php” file.
Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /home/baldwinj1/indiantrailweather.com/clientraw-parser/clientraw-parser.php on line 39
Line numbers: 39, 41, 43, 45, 47, 49, and 51 (possibly others). This error alone has generated ~115,000 errors in a 2 hour period.
Can you help shed some light/help with this error causing situation?
I’m working on the causes of some other errors. Hopefully I can eliminate the majority of the errors. In a 2 hour period the error log had ~ 475,000 errors.
I don’t recognize the original source for that clientraw parser… it’s not the TNETweather one I use.
I’ve fixed up the preg_match('something', with preg_match('/something/i', to fix the issue with the misspecified REGEX for matching. I don’t know if that will fix ALL the errata, but it should cut back your error_log entries.