Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8 Support #75

Closed
alorbach opened this issue Mar 24, 2021 · 8 comments · Fixed by #87
Closed

PHP8 Support #75

alorbach opened this issue Mar 24, 2021 · 8 comments · Fixed by #87

Comments

@alorbach
Copy link
Member

Check loganalyzer for php8 support and fix compatibility issues.

@recrunchi
Copy link

Hi. I just reinstalled my old server to upgrade it, and now i see that loganalyzer does not support php 8. Anybody knows if there is any advance on this? Thanks!

@Eraserstp
Copy link

I just commented out the content of the RemoveMagicQuotes() function in the /var/www/loganalyzer/include/functions_common.php file. It uses the get_magic_quotes_gpc() function, which was removed in PHP 8, since 7.4 it always returns false, so it is okay to just comment it.

@recrunchi
Copy link

I just commented out the content of the RemoveMagicQuotes() function in the /var/www/loganalyzer/include/functions_common.php file. It uses the get_magic_quotes_gpc() function, which was removed in PHP 8, since 7.4 it always returns false, so it is okay to just comment it.

Eraserstp, your solution works to me! Now i can use loganalyzer with php8.
Many thanks!

@kishchan
Copy link

i commented the RemoveMagicQuotes() Function but got a new error. any help would be appreciated.

Fatal error: Uncaught Error: Call to a member function LogStreamFactory() on null in /var/www/html/loganalyzer/index.php:228 Stack trace: #0 {main} thrown in /var/www/html/loganalyzer/index.php on line 228

@kishchan
Copy link

sooo i re-did the whole Server and now i am getting this error. any help would be much appreciated please.

Fatal error: Uncaught mysqli_sql_exception: Unknown column 'processid' in 'field list' in /var/www/html/loganalyzer/classes/logstreamdb.class.php:1682 Stack trace: #0 /var/www/html/loganalyzer/classes/logstreamdb.class.php(1682): mysqli_query() #1 /var/www/html/loganalyzer/classes/logstreamdb.class.php(1624): LogStreamDB->CreateMainSQLQuery() #2 /var/www/html/loganalyzer/classes/logstreamdb.class.php(545): LogStreamDB->ReadNextRecordsFromDB() #3 /var/www/html/loganalyzer/index.php(270): LogStreamDB->ReadNext() #4 {main} thrown in /var/www/html/loganalyzer/classes/logstreamdb.class.php on line 1682

@alorbach
Copy link
Member Author

sooo i re-did the whole Server and now i am getting this error. any help would be much appreciated please.

Fatal error: Uncaught mysqli_sql_exception: Unknown column 'processid' in 'field list' in /var/www/html/loganalyzer/classes/logstreamdb.class.php:1682 Stack trace: #0 /var/www/html/loganalyzer/classes/logstreamdb.class.php(1682): mysqli_query() #1 /var/www/html/loganalyzer/classes/logstreamdb.class.php(1624): LogStreamDB->CreateMainSQLQuery() #2 /var/www/html/loganalyzer/classes/logstreamdb.class.php(545): LogStreamDB->ReadNextRecordsFromDB() #3 /var/www/html/loganalyzer/index.php(270): LogStreamDB->ReadNext() #4 {main} thrown in /var/www/html/loganalyzer/classes/logstreamdb.class.php on line 1682

There are database fields missing, usually loganalyzer should create missing fields on the fly.
Here is a full SQL Script with all database fields:

CREATE TABLE `systemevents` (
  `ID` int(10) UNSIGNED NOT NULL,
  `CustomerID` int(11) NOT NULL DEFAULT 0,
  `ReceivedAt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `DeviceReportedTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Facility` int(11) NOT NULL DEFAULT 0,
  `Priority` int(11) NOT NULL DEFAULT 0,
  `FromHost` varchar(60) NOT NULL DEFAULT '',
  `Message` text NOT NULL,
  `NTSeverity` char(3) NOT NULL DEFAULT '',
  `Importance` char(3) NOT NULL DEFAULT '',
  `EventSource` varchar(60) DEFAULT NULL,
  `EventUser` varchar(60) NOT NULL DEFAULT '',
  `EventCategory` int(11) NOT NULL DEFAULT 0,
  `EventID` int(11) NOT NULL DEFAULT 0,
  `EventBinaryData` text NOT NULL,
  `MaxAvailable` int(11) NOT NULL DEFAULT 0,
  `CurrUsage` int(11) NOT NULL DEFAULT 0,
  `MinUsage` int(11) NOT NULL DEFAULT 0,
  `MaxUsage` int(11) NOT NULL DEFAULT 0,
  `InfoUnitID` int(11) NOT NULL DEFAULT 0,
  `SysLogTag` varchar(60) DEFAULT NULL,
  `EventLogType` varchar(60) DEFAULT NULL,
  `GenericFileName` varchar(60) DEFAULT NULL,
  `SystemID` int(11) NOT NULL DEFAULT 0,
  `Checksum` int(11) NOT NULL DEFAULT 0,
  `processid` varchar(60) NOT NULL DEFAULT ''
)

@dcolpitts
Copy link

With regards to "Fatal error: Uncaught mysqli_sql_exception: Unknown column 'processid' in 'field list'", it appeared as a 500 error in the browser. After lots of troubleshooting and testing, I found that config wizard created the table, and the first 24 columns, but the table did not have columns for Checksum or processid. I have no idea why.

The table create script that alorbach provide puked for me with an error (and yes I even dropped the table and tried it). Along the way I tried several other things.

I eventually discovered if ran this, it would fix it:

mysql -u root -p
USE Syslog;
ALTER TABLE SystemEvents
ADD COLUMN checksum INT NOT NULL;
ALTER TABLE SystemEvents
ADD COLUMN processid VARCHAR(60) NOT NULL;
exit

dcc

@pompfe
Copy link

pompfe commented Jul 10, 2024

addition:
you have to set checksum and processid default to NULL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants