Results 1 to 3 of 3

Thread: cron.php dies silently - help

  1. #1
    andypsykes is offline Junior Member
    Join Date
    Mar 2009
    Posts
    2

    Default cron.php dies silently - help

    I am running Sugarcrm-5.2.0a under Centos. I have set up crontab to call the cron.php script as shown on the Scheduler page but this task dies without any error log as far as I can tell. I have traced the problem to the "include/entryPoint.php" script that is called from cron.php.

    The entryPoint.php script dies silently when it tries to execute the following line:

    $db = DBManagerFactory::getInstance();

    Does anyone have any suggestion? Is it a permissions thing maybe?

  2. #2
    andypsykes is offline Junior Member
    Join Date
    Mar 2009
    Posts
    2

    Default Re: cron.php dies silently - help

    Update: I have found the problem. The solution may be of help to many who read this as I have seen a number of posts complaining about problems with the Scheduler which could all have the same cause.

    SugarCRM - at least the Linux version I installed - comes bundled with PHP. A logical thing if you want to make sure that everything works out of the box. Linux typically also comes bundled with PHP and, in my case at least, this was a different version to the one bundled with SugarCRM.

    Unless you do something different, the cron deamon runs the OS version of PHP and not the SugarCRM version. In my case it failed with the error I posted.

    In Lunix, the SugarCRM version of PHP resides in the /opt/<sugarcrm>/php/bin directory and has a corresponding .ini file in /opt/<sugarcrm>/php/etc. So, to ensure you are running the correct version of PHP against the cron.php script, ignore what the note on the Schedule screen says and put this in your crontab file:

    * * * * * cd /opt/<sugarcrm>/htdocs/sugarcrm; /opt/<sugarcrm>/php/bin/php -c /opt/<sugarcrm>/php/etc/php.ini -f cron.php >> /dev/null 2>&1

    Note that <sugarcrm> should be changed to your own SugarCRM install directory.

    To set up the cron task you ideally want to run it from the same user as is being used by Apache. You can find this from the following command (logged in as root):

    ps -ef | grep http

    You will see a bunch of lines in the form:

    nobody 27692 27691 0 05:50 ? 00:00:02 /opt/sugarcrm-5.2.0a/apache2/bin/httpd -f /opt/sugarcrm-5.2.0a/apache2/conf/httpd.conf

    The username apache is running under is the first entry on the line. In this case "nobody".

    To set up cron, do the following (again from the root account)

    crontab -u <username> -e

    where <username> is the Apache user shown above.

    This will put you into the default editor. Insert the crontab line given above (remember to edit the path name) and exit with a save. This should install the command in cron. To check this use:

    crontab -u <username> -l

    and you should see the line you have just entered.

    That's it. Bon Chance!

  3. #3
    sanjaykatiyar1's Avatar
    sanjaykatiyar1 is offline Sugar Community Member
    Join Date
    Feb 2006
    Location
    Bangalore
    Posts
    600

    Default Re: cron.php dies silently - help

    Very good finding, Andy !!
    Sanjay Katiyar
    iPhone and Android solutions http://www.apptility.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. can Sugar Plugin for Outlook be installed silently or unattended?
    By BigGrimace in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2009-01-06, 05:29 PM
  2. Replies: 2
    Last Post: 2008-09-10, 02:35 PM
  3. Admin - Upgrade wizard dies on me (5.0.0a)
    By bluefox112 in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2008-06-19, 12:58 PM
  4. setup wizard dies in step 7
    By pfraterdeus in forum Help
    Replies: 2
    Last Post: 2006-09-15, 03:29 AM
  5. Replies: 1
    Last Post: 2006-06-25, 05:42 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •