You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2019-11-07 14:39:53

viktor_sc
Member
Registered: 2018-06-26
Posts: 12

Cron.php not running - Link to the SQL server could not be established

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

#2 2019-11-28 12:40:32

viktor_sc
Member
Registered: 2018-06-26
Posts: 12

Re: Cron.php not running - Link to the SQL server could not be established

Hi,

does nobody have an idea?

thanks,

Offline

#3 2020-03-12 12:47:49

viktor_sc
Member
Registered: 2018-06-26
Posts: 12

Re: Cron.php not running - Link to the SQL server could not be established

Up smile
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

#4 2020-03-12 14:33:16

emaw_705
Member
Registered: 2020-02-06
Posts: 4

Re: Cron.php not running - Link to the SQL server could not be established

Hi @viktor_sc

Is the cron executed with the web server user?

Is the error appearing each execution of cron?

Regards.

Offline

#5 2020-03-12 17:06:48

grajek
Member
Registered: 2015-03-16
Posts: 69

Re: Cron.php not running - Link to the SQL server could not be established

Try to change "localhost" in your configuration to 127.0.0.1. This should do the trick.


GLPI 9.4.3 CentOS

Offline

#6 2020-03-12 21:40:55

viktor_sc
Member
Registered: 2018-06-26
Posts: 12

Re: Cron.php not running - Link to the SQL server could not be established

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

#7 2020-03-12 21:59:41

viktor_sc
Member
Registered: 2018-06-26
Posts: 12

Re: Cron.php not running - Link to the SQL server could not be established

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 smile
Awesome!!

Offline

Board footer

Powered by FluxBB