Skip to main content

Cron Job issue: PHP Fatal error: Call to undefined function mysqli_connect()

Comments

3 comments

  • dr_lucas
    ok, I did a bit more investigation and found out the cron is loading this configuration file:
    /home/XXXXX/php.ini
    Instead of the configuration file Apache and litespeed are using:
    /opt/cpanel/ea-php56/root/etc/php.ini
    Why does that happen and how can I fix it?
    0
  • dr_lucas
    I might be wrong but it seems like some kind of a bug. There was a php.ini file in my user directory, as stated above, so cron was using it. I disabled the file by renaming it to /home/XXXXX/php.ini.bak Now everything works fine.
    0
  • cPanelMichael
    I might be wrong but it seems like some kind of a bug. There was a php.ini file in my user directory, as stated above, so cron was using it. I disabled the file by renaming it to /home/XXXXX/php.ini.bak Now everything works fine.

    Hello, It's possible you are noticing this issue due to a change in how php.ini files are managed. This is discussed in more detail on the following threads: SOLVED - cPanel 66 Update MultiPHP INI Editor Changes php.ini changes in cPanel 66 Additionally, here's an example of how to use PHP in cron job commands: PHP command examples: General example: /usr/local/bin/php /home/username/public_html/path/to/cron/script Domain-specific example: /usr/local/bin/ea-php56 /home/username/domain_path/path/to/cron/script
    Thank you.
    0

Please sign in to leave a comment.