Cron - shared server (hostinger)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Steve2000
    Junior Member
    • May 2025
    • 3

    #1

    Cron - shared server (hostinger)

    Hi everyone,

    I hope you're all doing well. I'm reaching out because I've been struggling all day to get my cron job to work, but unfortunately, I haven't had any luck.

    I've tried the following command:

    * * * * * cd /home/xxxxxxxxxx/domains/MY-WEBSITE/public_html/SUBDOMAIN; /opt/alt/php83/usr/bin/php -f cron.php > /dev/null 2>&1

    After contacting Hostinger support, I also attempted this alternative:

    * * * * * cd /home/XXXXXXX/domains/MY-WEBSITE/public_html/SUBDOMAIN && /usr/bin/php -f cron.php > /dev/null 2>&1

    Despite my efforts, the cron job still isn't executing as expected. I'm currently on a shared server, so I'm not sure if there are any specific limitations or configurations I need to be aware of. By there way, I have other cron jobs on the server that are working fine using both wget and curl.

    If anyone has any suggestions or insights on what I might be doing wrong, I would greatly appreciate your help!

    Thank you in advance! Steve
  • lazovic
    Super Moderator
    • Jan 2022
    • 997

    #2
    Hi Steve2000,

    Please check the following thread: https://forum.espocrm.com/forum/gene...on-jobs-errors.

    Comment

    • Steve2000
      Junior Member
      • May 2025
      • 3

      #3
      Unfortunately, I’ve tried just about every approach I can find in EspoCRM forums, and still haven’t been able to get cron running correctly with EspoCRM 9.1.

      Comment

      • lazovic
        Super Moderator
        • Jan 2022
        • 997

        #4
        Steve2000,

        Please note that if you have two lines to run the EspoCRM cron, the cron will not work. You can also try something like this:

        * * * * * cd /home/XXXXXXX/domains/MY-WEBSITE/public_html/SUBDOMAIN; /usr/bin/php -f cron.php > /dev/null 2>&1

        Comment

        • Steve2000
          Junior Member
          • May 2025
          • 3

          #5
          With the help of Hostinger support, I've tested other cron scripts in the same directory using CLI via the HPanel scheduler, and they run without issue. This suggests the problem is specific to how the EspoCRM script is structured or executed, rather than a general cron or hosting issue.

          Comment

          • lazovic
            Super Moderator
            • Jan 2022
            • 997

            #6
            Steve2000

            I can assure you that people successfully use EspoCRM on Hostinger and run cron. Perhaps the problem is that you are using sherd hosting, not VPS, because sherd hostings often have various restrictions on running scripts. Try using this command and check the created log file:

            /usr/bin/php /home/u123456789/domains/yourdomain.com/public_html/yoursubdomain/cron.php >> /home/u123456789/domains/yourdomain.com/public_html/yoursubdomain/cron.log 2>&1

            Also check if the corresponding checkbox is marked in the settings of your instance and make sure that the correct permissions and ownership are set for the EspoCRM directory.

            Comment

            Working...