CodeIgniter Forums

Full Version: Cron execution error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am new with CodeIgniter (amazing framework i love it thanks) , so sorry for newbie question !
I have a correct piece of code in my controller. If i run it in cron i get error:

/usr/local/bin/php  /home/XXXXXXXXXXXXX/public_html/gestionale/index.php Calendar appuntamenti

A PHP Error was encountered

Severity:    Warning
Message:     mysqli::real_connect(): (HY000/2002): No such file or directory
Filename:    /home/XXXXXXXXXXXX/public_html/gestionale/system/database/drivers/mysqli/mysqli_driver.php
Line Number: 203

        File: /home/XXXXXXXXXXX/public_html/gestionale/index.php
        Line: 315
        Function: require_once

Database error: A Database Error Occurred

        Unable to connect to your database server using the provided settings.
        Filename: core/CodeIgniter.php
        Line Number: 518

any help please ? thanks
Did you setup ./application/database.php for your database settings?
in your config/database.php, try to change hostname from localhost to
yessss did the magic ! thanks