Closed StormTrooper closed 4 years ago
data_debug.php line 530: $issue_title = implode($issues, ' < br/ >');
Because in PHP 4 and PHP 5, function implode(string $glue , array $pieces ) accept parameters in two order , so implode(array $pieces , string $glue) also works. But in PHP 7, function implode()'s parameters order is strict to implode(string $glue, array $pieces). how to resolved: data_debug.php line 530 swap the parameters: $issue_title = implode( '< br/ >', $issues);
I think bugs about PHP5 and PHP7's compatibility should be fixed in the future cacti version, for PHP7 is being actively supported while PHP5 is no longer supported.
.
This actually affects a few places:
data_debug.php:530: $issue_title = implode($issues, '<br/>');
lib/database.php:421: db_echo_sql('db_fetch_row_prepared(\'' . clean_up_lines($sql) . '\', $params = (\'' . implode($params, '\', \'') . '\'), $log = ' . $log . ', $db_conn = ' . ($db_conn ? 'true' : 'false') .')' . "\n");
lib/dsdebug.php:248: $c['issue'][] = __('Failed fields: ') . implode($f, ', ');
plugins/mactrack/Net/DNS2/RR/CAA.php:115: $this->value = trim($this->cleanString(implode($rdata, ' ')),
'"');
include/vendor/motranslator-4.0/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php:56: return trim(preg_replace('|<.+>|', '', implode($parts, ' ')));
Some of these are part of third party libraries so not something we would fix ourselves normally. Will have to see if there is anything we can submit to them.
Please note, Cacti 1.2.x is not currently tested under PHP 7.4. You will get other errors such as:
https://wiki.php.net/rfc/deprecate_curly_braces_array_access
As that requires a larger change and testing, for now PHP 7.4 is going to throw a lot of errors running Cacti. @paulgevers and @mortenstevens
Log files are filling up with ERROR PHP DEPRECATED
To Reproduce Log onto dashboard, click on Logs
Server OS: Windows 7, 32 bit
Cacti: 1.2.8
Apache: Server version: Apache/2.4.41 (Win32) Server built: Aug 10 2019 12:59:56
PHP 7.4.0 (cli) (built: Nov 27 2019 10:15:52) ( ZTS Visual C++ 2017 x86 )
MySQL: Server version: 5.5.62-log MySQL Community Server (GPL)