Common.php

I installed librenms on RedHat 6.10, but when run ./validate.php. I get this error: “PHP Parse error: syntax error, unexpected ‘[’ in /opt/librenms/validate.php on line 133”. I looked at line 133 but could not see any issue.

if ($pre_checks_failed) {
exit;
}

$init_modules = []; <— line 133
require ‘includes/init.php’;

// make sure install_dir is set correctly, or the next includes will fail
if (!file_exists(Config::get(‘install_dir’).’/config.php’)) {
$suggested = realpath(DIR);
print_fail(’$config[‘install_dir’] is not set correctly.’, “It should probably be set to: $suggested”);
exit;
}

Any suggestions how to fix this please?

I know Kevin replied but I could not view it. Sorry

Hi @shak63
Could you start with php -v ? I suppose that you have some prerequisites that are not met, and as validate itself does not run, we’ll have to check manually step by step.

Howdy,
when I run php -v here is the output:
I upgraded php from 5.3.3 to 5.6

php -v
PHP 5.6.40 (cli) (built: Apr 2 2019 12:54:54)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

When I tried running launching the web installer, I get this error:

Error: Missing dependencies! Run the following command to fix:

./scripts/composer_wrapper.php install --no-dev

But when I run this ./scripts/composer_wrapper.php install --no-dev, did not work.

Please note the minimum supported PHP version is 7.1.3

https://docs.librenms.org/Installation/

I Finally installed it but when I logged in to the browser, I get an error. Attaching the screenshot

Check your database credentials are correct

https://docs.librenms.org/Support/FAQ/#where-do-i-update-my-database-credentials

Thank you for the reply. I checked both config.php and .env to confirm that both have the correct info. still an issue

according to that error message it says your are using “USERNAME” and password of “YES” is that correct??

That is correct!

That error is only on web browser. I can connect to DB. Of course I did not add any devices yet. Attaching a screenshot

Show contents of .env without password

When you followed the install guide did you grant all privledges for that user to the librenms database?

I think the command to check is something like show grants for 'USERNAME'@'localhost';

For some reason I used the show grants command you provided and neither root or librenms have access :frowning:

attaching the .env file

I managed to grant access back the database but still cannot login to web as both root, or librenms. with this error:

SQLSTATE[HY000] [1045] Access denied for user ‘librenms’@‘localhost’ (using password: YES)

Howdy,
I made sure librenms and root have have access in the DB, but I cannot login to the web and get Access denied for both user. Would someone please have any suggestions?
Attaching the screenshot

Thanks to everyone for all the help I got!!!

How did you fix ?

This is what I did, not sure what fixed it: made sure I granted user
mysql> GRANT ALL PRIVILEGES ON . TO ‘root’@‘localhost’;
mysql> FLUSH PRIVILEGES;
Then retype the password in .env, rebooted and tried again. Not sure what fixed it, but I was able to get to librenms page

1 Like

I apologize in advance. Validte_php

My librenms vm had an issues with kernel, re-imaged the system. The os is Red Hat 6 Enterprise. I got it installed fully, I was able to access the database from the command line with root and librenms. They have all permission. I ran ./validate.php and no errors. Attaching the screenshots.

Is the problem you can’t login? looks like your trying to login to the GUI with your sql credentials are you sure thats correct?

You can create a new user with admin to reset,

./adduser.php <USERNAME> <PASSWORD> 10

#https://docs.librenms.org/Installation/Installation-Ubuntu-1404-Apache/#create-admin-user