Cron error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joostk
    Junior Member
    • Nov 2020
    • 21

    Cron error

    Hej all,

    Hope you are doing good; the followin issue on my side at the moment.

    Installing ESPOcrm using Strato as a hosting provider, it seems almost impossible to get the cronjobs working. I have already seen an older topic were it was suggested to comment out certain lines in the cron.php file. This seems not to fix issue and I still receive the message: Can be run only via CLI.

    Link to the older topic:
    when i run cron in cpanel using this line: /usr/local/php55/bin/php -f /home/user/public_html/crm/cron.php i get: Cron can be run


    Any suggestions?

    Many thanks!

    Joost
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2
    Hello,

    if you browse to : https://mycrm/cron.php
    you get normaly a response like this : Can be run only via CLI.

    if you comment in cron.php .. you can run cron.php (tested in version below 6.x)

    I can't understand a provider you don't have cron.
    you must configure contab in you admin panel of provider.
    all info is in admin section of espocrm :

    Note: Add this line to the crontab file to run Espo Scheduled Jobs:
    * * * * * cd /var/www/vhosts/crm/htdocs; /usr/bin/php -f cron.php > /dev/null 2>&1
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • joostk
      Junior Member
      • Nov 2020
      • 21

      #3
      Originally posted by item
      Hello,

      if you browse to : https://mycrm/cron.php
      you get normaly a response like this : Can be run only via CLI.

      if you comment in cron.php .. you can run cron.php (tested in version below 6.x)

      I can't understand a provider you don't have cron.
      you must configure contab in you admin panel of provider.
      all info is in admin section of espocrm :

      Note: Add this line to the crontab file to run Espo Scheduled Jobs:
      * * * * * cd /var/www/vhosts/crm/htdocs; /usr/bin/php -f cron.php > /dev/null 2>&1
      Thanks for your reply. My question is more on how I can make it possible to have the cron.php approached from the browser and not only via the CLI.

      Thanks!

      Comment

      • emillod
        Active Community Member
        • Apr 2017
        • 1405

        #4
        Originally posted by joostk

        Thanks for your reply. My question is more on how I can make it possible to have the cron.php approached from the browser and not only via the CLI.

        Thanks!
        item already gave you propper response. You have to modify cron file.

        Comment

        • joostk
          Junior Member
          • Nov 2020
          • 21

          #5
          Originally posted by emillod

          item already gave you propper response. You have to modify cron file.
          Thanks for your reply.

          Please find attached a screenshot from the cron.php file. This still gives the result "Can be run only via CLI", which seems to be a little weird to me.

          Hoping for suggestions. Thanks!

          Comment

          • item
            Active Community Member
            • Mar 2017
            • 1476

            #6
            Hello,
            in v6.. as you see : Cron::Class.. so you have to look in :
            application/espo/core/Application.php :
            line 83 ..

            EDIT : https://forum.espocrm.com/forum/inst...on-using-plesk

            Last edited by item; 09-27-2021, 07:32 PM.
            If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

            Comment

            • arrestthepresident
              Member
              • Jun 2021
              • 43

              #7
              Hey, i hope this is not too late now but for every fellow "kraut" here wondering why this is a problem on strato-webhosting-server.: they have two seperate "cron.php"s in their system. The one Espo often suggests to use is not gonna work because reasons (probably because the Strato backend does not call the php-file via CLI-Channel). Instead they have a cron-cli.php in the same directory which in my case runs perfectly when called in the Cron-Section in the admin-interface of your Strato-package.

              Also: Because the do not allow to set "Crons" running at a higher frequency than one per hour (damn 'em), as a workaround you can/have to set the same job say four times in a quater-hour distance from another. That way you only have to define four Jobs for cron to start running every 15mins.

              If still you encounter this problem let me know.

              Comment

              • arrestthepresident
                Member
                • Jun 2021
                • 43

                #8
                rel: https://forum.espocrm.com/forum/gene...n-only-via-cli

                Comment

                Working...