You are not logged in.
Hi,
I'm running GLPI 9.4.4 on my Synology NAS with web station. It runs fine and I can open the application in my browser without any issues.
Now, to be able to get notifications without logging in I understand that I have to run the cron.php from a scheduled job. To schedule the job is not an issue, but the job itself.
Whenever I run it from a scheduled job or manually in a command line I get this error:
Command:
/usr/local/bin/php73 /volume1/web/glpi/front/cron.php
Error:
A link to the SQL server could not be established. Please check your configuration.
Le serveur Mysql est inaccessible. Vérifiez votre configuration
The command should be correct as I use PHP 7.3.
Also, my config_db.php should be correct as I can open the application. It contains:
<?php
class DB extends DBmysql {
public $dbhost = 'localhost';
public $dbuser = 'XXXX';
public $dbpassword = 'XXXX';
public $dbdefault = 'glpi';
}
Is there any place I need to configure the connection for the cron.php or something like this?
Thanks for any help,
Viktor
Offline
Hi,
does nobody have an idea?
thanks,
Offline
Up
I still have this issue with 9.4.5. Appreciate every hint.
Thanks
Last edited by viktor_sc (2020-03-12 12:48:11)
Offline
Hi @viktor_sc
Is the cron executed with the web server user?
Is the error appearing each execution of cron?
Regards.
Offline
Try to change "localhost" in your configuration to 127.0.0.1. This should do the trick.
GLPI 9.5.1 CentOS
Offline
Hi,
Thanks for your answer.
I tried the command in the command line as an administrator. So the permissions should be sufficient, I think. Yes, each time I run the command, the error appears.
Funny you mention it, today I tried to use '127.0.0.1' instead of 'localhost' in the config_db.php. After changing that, I couldn't access the web ui at all. Error:
A link to the SQL server could not be established. Please check your configuration.
Le serveur Mysql est inaccessible. Vérifiez votre configuration
GLPI 9.4.5 Copyright (C) 2015-2019 Teclib' and contributors
And the same error as before in the command line.
Now I'm confused. What could be the reason that 127.0.0.1 isn't working? Probably that's the reason it doesn't work from the command line...
Last edited by viktor_sc (2020-03-12 21:47:56)
Offline
Alright guys! Problem seems to be solved!
When I use '127.0.0.1:3307' as the hostname in the configuration file (where 3307 is the port) the command runs in the command line
Awesome!!
Offline