You are here:  » Cron Error

Active Forum Topics


Cron Error

Submitted by crounauer on Wed, 2021-10-13 23:23 in

Hi David,

I have just changed hosts and everything is working apart from getting an error when I run cron.

{code saved}

and I get this error

Fatal error: Call to undefined function mysqli_connect() {code saved}

I get the same error when running the command on Putty and I've tried changing file permissions. The code on fetch.php remains unchanged since it last worked. I'm running php 7.3, could that be an issue?

Is there a way on Putty to debug the process step by step?

Submitted by support on Thu, 2021-10-14 07:58

Hi,

That's strange - assuming that the site is working fine that implies that the CLI (command line) version of PHP does not have the MySQL libraries installed. In most cases the installations are synchronised so whenever you install PHP and add a library it is installed for both the Apache module and CLI versions of PHP.

You probably need to check this one with your host as it would need root access and ask them to install MySQL for the command line version of PHP on your server...

Cheers,
David.
--
PriceTapestry.com

Submitted by crounauer on Mon, 2021-10-18 23:03

Hi David,

Just a FYI...

I am using php 7.3 and in CRON jobs that means with this specific host I use that you have to specify the php version in the CRON command

cd {path to}/scripts;/usr/bin/php-7.3 cron.php > ../logs/cron.log

Their tech support didn't know that ;( It's taken me forever to figure that out!

Cheers for your awesome support!

Simon