Error undefined function mysqli_connect on Cron Job

356 Views Asked by At

I have a problem executing a Cronjob with Virtualmin and Nginx. I have to execute a php script. When I execute it with cronjob I have this error:

PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_connect() in /home/ivirgin/public_html/check.php:36
Stack trace:
#0 {main}
  thrown in /home/ivirgin/public_html/check.php on line 36

Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /home/ivirgin/public_html/check.php:36
Stack trace:
#0 {main}
  thrown in /home/ivirgin/public_html/check.php on line 36

While, if I execute the script without cronjob but writing address on browser, I have not errors.

This is the command that I inserted in Cronjob:

php -f /home/ivirgin/public_html/check.php

Can anyone help me to solve it? Thanks!

0

There are 0 best solutions below