There are some prerequisites the admin will need to fulfill:
1. Is the PHP binary (either CLI or CGI) in the Apache user's path?
If you have root user or sudo access to your webserver, login as root then type "
su [apache|nobody|your apache user name]". After you have successfully become the apache user, type "
php -v".
If you get some output like "
PHP 4.4.1 (cli) (built: May 25, 2005 14:43:03)" then you're done with this step.
If you get error output like "
php: command not found", you'll need to figure out where the binary is by typing "which php". Most secure Linux installations will not allow the apache user to have startup scripts, some won't even allow a home directory. You will need to find out what paths the apache user has access to, and add a
symlink to the PHP binary in those paths. Tough eh? Not really.

Two more steps:
i. type "echo $PATH" and note what paths are available. Typically, the apache user will have "/bin:/usr/bin:/usr/local/bin" etc. in its path. Now navigate to say "/usr/local/bin".
If you're still operating as apache, type "exit" to get back to being the root user.
ii. In /usr/local/bin type "ln -s /path/to/the/php/binary/php ." (this is the same as the output you got from "which php". Okay, done here.
2. Is the crontab setup correctly?
Now it is time to double check your crontab entry - still as root, type
crontab -e to enter the crontab editor (vi). If the line that Sugar's Scheduler screen is not there, add it now. If it is there, double check that it's formatted correctly:
Code:
* * * * * cd /path/to/sugar/crm; php -f cron.php > /dev/null 2&>1
If all is well, you should be able (as the apache user) type in that command above (minus the asterisks) and get some output - AND more importantly, begin using Inbound Email
From mdougher:
Here's a little script to run the scheduler and get your emails.
Set up Admin->Scheduler and select MonitoredEmail every minute.
Copy the following text into a file (sugarcrmcron.sh) and add it to cron instead of the command line. Change the directories or paths to appropriate for you.
PATH=/opt/sugarcrm-3.5.1/mysql/bin:/opt/sugarcrm-3.5.1/php/bin:/usr/bin:/usr/local/bin
LD_LIBRARY_PATH=/opt/sugarcrm-3.5.1/mysql/lib:/opt/sugarcrm-3.5.1/php/lib
cd /opt/sugarcrm-3.5.1/apache/htdocs/sugarcrm; php -f cron.php
Setup the following crontab:
* * * * * /opt/sugarcrm-3.5.1/mattrun.sh >/dev/null 2>&1
Setting up the Windows batch file.
1. Go to the Scheduler screen in Admin -> Schedulers. At the bottom of the default screen, you will see the contents of the commands you need to add to a batch file. To create a batch file in Windows, open notepad.exe, copy & paste the what Sugar tells you too into a blank file.
When saving,
and this is VERY important, change the
Save As Type: dropdown to
All Files *.*. Give it any name you want, but make sure the extension is
.bat. Test it by double-clicking the batch and making sure you pull down some emails from your inbox.
PHP 4.x
If your system has a 4.x flavor of PHP, your PHP-CGI binary is name
php.exe and it
should be in the root folder of your PHP install folder. This is the one you want to use. In order to it to play nicely with dynamic libraries, you will have to tell it where your
php.ini file is located. This can vary from system to system. When in doubt, let PHP tell you - run phpinfo(); and it will return where and which php.ini file it is using. For the example, I will assume that it is located in c:\windows
A t this point, you need to adjust the pathing to your php.exe binary. It will probaly now look something like this:
Code:
c:\path\to\PHP4\php.exe -c c:\windows\php.ini -f cron.php
PHP 5.x
If your system has a 5.x flavor of PHP, your PHP-CGI binary is name
php-cgi.exe and it
should be in the root folder of your PHP install folder. This is the one you want to use. In order to it to play nicely with dynamic libraries, you will have to tell it where your
php.ini file is located. This can vary from system to system. When in doubt, let PHP tell you - run phpinfo(); and it will return where and which php.ini file it is using. For the example, I will assume that it is located in c:\windows
A t this point, you need to adjust the pathing to your php.exe binary. It will probaly now look something like this:
Code:
c:\path\to\PHP5\php-cgi.exe -c c:\windows\php.ini -f cron.php
2. Once saved, create a new Scheduled Task through
Start -> Control Panel -> Scheduled Tasks -> Add Scheduled Task.
Go through the wizard. Select the batch file you just created by
Browse'ing for it.
At the next screen, have it perform
Daily. Select the defaults as needed (remember to give it a good User/Password when it gets to that screen), and then make sure you check off
Open advanced properties for this task when I click finish.
When Advanced Properties opens, go to the tab named
Schedule and then click the
Advanced... button.
Check off
Repeat task to enable the fields below it, and have it repeat
Every Minute (or whatever you find appropriate. Save your changes and enjoy!
Bookmarks