Announcement

Collapse
No announcement yet.

Cronjob Error - Mysqli is required

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cronjob Error - Mysqli is required

    Hi all,

    Trying to get a cronjob working for a client. But the email the cronjob sends out gives off the following error:


    mysqli is required but can't be found. Aborting!!!
    Whats the best way of getting mysqli enabled/installed for the server? It seems to be installed for the PHP that the website uses as it shows up on the php info page. This is when the cronjob has been set with the following:

    php /path/to/file.php/

    The script actually does what it needs to do when you load the .php file in the browser. But isn't able to run the cronjob as it looks like it requires mysqli but is unable to find it.
    Last edited by Bertie; 10-30-2018, 10:26 AM.

  • #2
    Hi Bertie

    I am sorry, you have not given a lot of information, so ot be sure you have mysqli you could SSH into server and run as sudo or root php -m | grep mysqli

    This should show you you have mysqli

    To be fair, you have already confirmed mysqli is installed and working but above is a double check

    You may want to try adjusting the cron path as I posted some time

    I thought I would post over setting up a cron path, so users find it easier as follows:
    php -f /chroot/home/siteworx-name/yourdomain.url/html/path/to/cron.php
    (you do not have to use /chroot, and some may not have /chroot, so maybe better to use /home/siteworx-name/yourdomain.url/html/path/to/cron.php)
    so, if you need to setup a cron, and shown /usr/bin/php -f, please use above

    However, apologies if I am wrong as you have not shown full cron

    Is there any errors shown in cron logs and if you SSH into server and run cron, does that error

    I hope that helps a little

    Many thanks

    John

    Comment


    • #3
      Originally posted by d2d4j View Post
      Hi Bertie

      I am sorry, you have not given a lot of information, so ot be sure you have mysqli you could SSH into server and run as sudo or root php -m | grep mysqli

      This should show you you have mysqli

      To be fair, you have already confirmed mysqli is installed and working but above is a double check

      You may want to try adjusting the cron path as I posted some time

      I thought I would post over setting up a cron path, so users find it easier as follows:
      php -f /chroot/home/siteworx-name/yourdomain.url/html/path/to/cron.php
      (you do not have to use /chroot, and some may not have /chroot, so maybe better to use /home/siteworx-name/yourdomain.url/html/path/to/cron.php)
      so, if you need to setup a cron, and shown /usr/bin/php -f, please use above

      However, apologies if I am wrong as you have not shown full cron

      Is there any errors shown in cron logs and if you SSH into server and run cron, does that error

      I hope that helps a little

      Many thanks

      John
      Hi John,

      php -m | grep mysqli

      Returns with mysqli.

      I have the following settings in the cronjob area:

      Shell: /bin/sh
      Path:
      /opt/remi/php56/root/usr/bin
      /opt/remi/php56/root/usr/sbin
      /usr/local/bin
      /bin
      /usr/bin
      /usr/local/sbin
      /usr/sbin
      /sbin
      /home/interworx/bin
      /usr/bin/php
      Script:
      php -f /home/username/domain.co.uk/html/catalog/googlesitemap/index.php
      Which then returns with: mysqli is required but can't be found. Aborting!!! ---

      Can't see any errors in the cron log file but they have these entries;

      Oct 31 08:53:01 ipanel CROND[12542]: (root) CMD (cd /tmp && iostat -xkd 30 2 | sed 's/,/\./g' > io.tmp && mv io.tmp iostat.cache)
      Oct 31 08:53:01 ipanel CROND[12545]: (duncans) CMD (php -f /home/username/domain.co.uk/html/catalog/googlesitemap/index.php)



      I've tried running the cron via command line. Is it just:

      php -f /home/user/domain.co.uk/html/catalog/googlesitemap/index.php ? If so, then no errors but the files don't get recreated like they would do if you visited the index.php file in the browser.
      Last edited by Bertie; 10-31-2018, 04:25 AM.

      Comment


      • #4
        Hi Bertie

        Many thanks

        Do you mind me asking if this is a magento site, if so, you use cron.php for cron jobs for magento

        You could try the below which should work I think, as I think your current cron is not able to find say a config-include.php file or similar for the mysql connection

        You could run this manually first by SSH and see if it updates the file, if so, just add this as cron job

        curl http://domain.co.uk/catalog/googlesitemap/index.php (or whatever the url you browse to load the page)

        Many thanks and sorry if I am wrong

        John

        Comment


        • #5
          Originally posted by d2d4j View Post
          Hi Bertie

          Many thanks

          Do you mind me asking if this is a magento site, if so, you use cron.php for cron jobs for magento

          You could try the below which should work I think, as I think your current cron is not able to find say a config-include.php file or similar for the mysql connection

          You could run this manually first by SSH and see if it updates the file, if so, just add this as cron job

          curl http://domain.co.uk/catalog/googlesitemap/index.php (or whatever the url you browse to load the page)

          Many thanks and sorry if I am wrong

          John
          Hi John, its not a magento site but running it was a curl seems to have done the trick.

          Comment

          Working...
          X