It may be a trivial question, but how can I check if the cron works well?
I’ve setup a cronjob cd /home/irnndaeb/suite.100asa.it; php -f cron.php > /home/irnndaeb/suite.100asa.it/logs/cron.log 2>&1 but my cron.log is always empty and list of scheduler it does not make me see if the execution is successful.
Check at the end of this article:
https://pgorod.github.io/Scheduler-Jobs/
The cron jobs write their logs into suitecrm.log, not cron.log.
In the Admin / Schedulers, inside each job, you should be able to see the last time it ran successfully.
https://pasteboard.co/GWbobAG.png
I see only this
In log always see
ri Dec 1 11:13:39 2017 [677260][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone=“UTC” in php.ini!
Now I’m using the 7.8.8 LTS, because the 7.9.7 have issue on sent email
On that list, you need to click to enter a specific Job, to see the last run time.
Anyway, I think your problem is related to that error in the logs, you need to set the timezone.
Try changing your cron command like this:
cd /home/irnndaeb/suite.100asa.it; php -d date.timezone="Europe/Lisbon" -f cron.php > /home/irnndaeb/suite.100asa.it/logs/cron.log 2>&1
(change that to your own time zone, of course)
Now check if the errors are gone from the log.
same issue with your suggestion:
-
-
-
-
- cd /home/irnndaeb/suite.100asa.it; php -d date.timezone=“Europe/Rome” -f cron.php > /home/irnndaeb/suite.100asa.it/logs/cron.log 2>&1
log say:
ri Dec 1 11:23:36 2017 [710976][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone=“UTC” in php.ini!
here is what I see into workflow
https://pasteboard.co/GWbuIj6.png
- cd /home/irnndaeb/suite.100asa.it; php -d date.timezone=“Europe/Rome” -f cron.php > /home/irnndaeb/suite.100asa.it/logs/cron.log 2>&1
-
-
-
That’s still not the correct screenshot
That’s the Edit view of a single Job, I mean the simple Detail View, where at the top you have some information about when it last ran.
I don’t know why it’s not picking up the parameter with the timezone. It could be set from the correct php.ini, but I’m not sure you will have access to that php.ini (there are several in your system, and on shared hostings sometimes it’s complicated).
You could ask your hosting how you’re supposed to set it ofr the CLI PHP (not the Apache PHP!).
My phpinfo say:
https://pasteboard.co/GWbDqtT.png
Oh, undertsand, you mean…
https://pasteboard.co/GWbFq42.png
Yes, now that is the correct screenshot! Your jobs are definitely not running successfully…
About the phpinfo: remember you have two different PHP’s, and two different php.ini’s, one for CLI (command-line, the other for the Web server).
But it seems you didn’t even set the date.timezone for the Web server, let’s start with that. Do you know where your php.ini is? Can you add there date.timzone=“Europe/Rome” ?
Just asked my hosting provider.
Now I’ve (setting by .htaccess)
https://pasteboard.co/GWchCIh.png
so suitecrm.log doesn’t have the date.timezone error.
But workflow process doesn’t start.
That’s one PHP you’ve covered, now you need the other.
Do you have access to a command-line? If so, please tell me the results of these commands:
which php
php -i | grep timezone
php -i | grep php.ini
crontab -l
cat /etc/crontab
Can you edit any of those files and correct the date.timezone?
Loaded Configuration File => /opt/alt/php70/etc/php.ini
Additional .ini files parsed => /opt/alt/php70/link/conf/alt_php.ini,
Also, please tell me the output of this command given in your SuiteCRM root folder:
ls -al
When you paste the results here, put it inside the forum’s “code” tags so it gets displayed correctly. Thanks.
I’m on shared hosting, I cannot edit those files.
My correct timezone is Europe/Berlin (same timezone of Rome)
totale 44088
drwxr-xr-x 23 irnndaeb nobody 4096 1 dic 15:59 .
drwx--x--x 37 irnndaeb irnndaeb 4096 1 dic 15:58 ..
drwxrwxr-x 15 irnndaeb irnndaeb 4096 30 nov 18:38 cache
-rwxr-xr-x 1 irnndaeb irnndaeb 3590 18 ott 10:41 campaign_tracker.php
drwxr-xr-x 2 irnndaeb irnndaeb 4096 28 nov 18:44 cgi-bin
-rwxr-xr-x 1 irnndaeb irnndaeb 462 18 ott 10:41 composer.json
-rwxr-xr-x 1 irnndaeb irnndaeb 17908 18 ott 10:41 composer.lock
-rwxrwxr-x 1 irnndaeb irnndaeb 936 1 dic 12:37 config_override.php
-rwxr-xr-x 1 irnndaeb irnndaeb 10745 1 dic 08:35 config.php
-rwxr-xr-x 1 irnndaeb irnndaeb 5052 18 ott 10:41 cron.php
-rwxr-xr-x 1 irnndaeb irnndaeb 2446 18 ott 10:41 crossdomain.xml
drwxrwxr-x 9 irnndaeb irnndaeb 4096 30 nov 19:00 custom
drwxrwxr-x 3 irnndaeb irnndaeb 4096 18 ott 10:41 data
-rwxr-xr-x 1 irnndaeb irnndaeb 2388 18 ott 10:41 dictionary.php
-rwxr-xr-x 1 irnndaeb irnndaeb 12541 18 ott 10:41 download.php
-rwxr-xr-x 1 irnndaeb irnndaeb 2392 18 ott 10:41 emailmandelivery.php
-rwxr-xr-x 1 irnndaeb irnndaeb 4912 18 ott 10:41 export.php
-rwxr-xr-x 1 irnndaeb irnndaeb 967627 18 ott 10:41 files.md5
-rwxr-xr-x 1 irnndaeb irnndaeb 2811 18 ott 10:41 HandleAjaxCall.php
-rw-r--r-- 1 irnndaeb irnndaeb 1411 1 dic 13:33 .htaccess
-rwxr-xr-x 1 irnndaeb irnndaeb 2367 18 ott 10:41 ical_server.php
drwxr-xr-x 56 irnndaeb irnndaeb 4096 18 ott 10:41 include
-rwxr-xr-x 1 irnndaeb irnndaeb 2374 18 ott 10:41 index.php
drwxr-xr-x 6 irnndaeb irnndaeb 4096 30 nov 18:28 install
-rw-r--r-- 1 irnndaeb irnndaeb 17843 30 nov 18:28 install.log
-rwxr-xr-x 1 irnndaeb irnndaeb 32077 18 ott 10:41 install.php
-rwxr-xr-x 1 irnndaeb irnndaeb 2275 18 ott 10:41 json_server.php
drwxr-xr-x 3 irnndaeb irnndaeb 4096 18 ott 10:41 jssource
-rw-r--r-- 1 irnndaeb irnndaeb 315 30 nov 18:39 Leggimi.txt
-rwxr-xr-x 1 irnndaeb irnndaeb 34539 18 ott 10:41 LICENSE.txt
-rwxr-xr-x 1 irnndaeb irnndaeb 2313 18 ott 10:41 log_file_restricted.html
drwxr-xr-x 2 irnndaeb irnndaeb 4096 1 dic 07:59 logs
-rwxr-xr-x 1 irnndaeb irnndaeb 2376 18 ott 10:41 maintenance.php
-rw-r--r-- 1 irnndaeb irnndaeb 676 30 nov 18:39 manifest.php
drwxr-xr-x 2 irnndaeb irnndaeb 4096 18 ott 10:41 metadata
drwxr-xr-x 3 irnndaeb irnndaeb 4096 18 ott 10:41 ModuleInstall
drwxrwxr-x 112 irnndaeb irnndaeb 4096 18 ott 10:41 modules
-rwxr-xr-x 1 irnndaeb irnndaeb 2890 18 ott 10:41 pdf.php
-rwxr-xr-x 1 irnndaeb irnndaeb 306 18 ott 10:41 php_version.php
drwxrws--- 4 irnndaeb irnndaeb 4096 30 nov 18:39 portal
drwxrws--- 2 irnndaeb irnndaeb 4096 1 dic 15:54 public
-rwxr-xr-x 1 irnndaeb irnndaeb 3157 18 ott 10:41 README.md
-rwxr-xr-x 1 irnndaeb irnndaeb 73 18 ott 10:41 robots.txt
-rwxr-xr-x 1 irnndaeb irnndaeb 3588 18 ott 10:41 run_job.php
drwxr-xr-x 12 irnndaeb irnndaeb 4096 18 ott 10:41 service
drwxr-xr-x 2 irnndaeb irnndaeb 4096 18 ott 10:41 soap
-rwxr-xr-x 1 irnndaeb irnndaeb 4091 18 ott 10:41 soap.php
-rw-r--r-- 1 irnndaeb irnndaeb 126345 30 nov 18:28 sugarcrm.log
-rwxr-xr-x 1 irnndaeb irnndaeb 5327 18 ott 10:41 SugarSecurity.php
-rwxr-xr-x 1 irnndaeb irnndaeb 154 18 ott 10:41 sugar_version.json
-rwxr-xr-x 1 irnndaeb irnndaeb 2296 18 ott 10:41 sugar_version.php
drwxr-xr-x 2 irnndaeb irnndaeb 4096 30 nov 18:20 SuiteCRM-7.8.8
-rwxr-xr-x 1 irnndaeb irnndaeb 43597076 30 nov 18:19 SuiteCRM-7.8.8.zip
-rw-r--r-- 1 irnndaeb irnndaeb 64807 1 dic 16:48 suitecrm.log
-rwxr-xr-x 1 irnndaeb irnndaeb 169 18 ott 12:41 suitecrm_version.php
-rw-r--r-- 1 irnndaeb irnndaeb 19 1 dic 13:34 test_php.php
drwxrwxr-x 6 irnndaeb irnndaeb 4096 18 ott 10:41 themes
-rwxr-xr-x 1 irnndaeb irnndaeb 5843 18 ott 10:41 TreeData.php
drwxrwxr-x 4 irnndaeb irnndaeb 4096 1 dic 16:40 upload
-rwxr-xr-x 1 irnndaeb irnndaeb 2248 18 ott 10:41 vcal_server.php
-rwxr-xr-x 1 irnndaeb irnndaeb 2980 18 ott 10:41 vCard.php
drwxr-xr-x 3 irnndaeb irnndaeb 4096 28 nov 18:45 .well-known
drwxr-xr-x 2 irnndaeb irnndaeb 4096 18 ott 10:41 XTemplate
drwxr-xr-x 8 irnndaeb irnndaeb 4096 18 ott 10:41 Zend
To make sure your permissions are correct, let’s give these three commands from that same directory:
chown -R irnndaeb:irnndaeb .
chmod -R 755 .
chmod -R 775 cache custom modules themes data upload config_override.php
Note that two of those commands end with a space followed by a dot " ."
I am also curious why “which php” didn’t return anything?
Maybe try this one:
php -i | grep "'_'"
This is to find out the path of your php executable, so that we can add that to your cron command. In my system, that gives “/usr/bin/php”, so the cron command would change to
* * * * * cd /home/irnndaeb/suite.100asa.it; /usr/bin/php -f cron.php > /dev/null 2>&1
all commands done!
to the command php -i | grep “’_’”
$_SERVER['_'] => /usr/local/bin/php
$_ENV['_'] => /usr/local/bin/php
https://pasteboard.co/GWjj4gP.png
Now works great!
:silly: :silly: :silly: :woohoo: :woohoo: :woohoo:
@pgr you’re simply GREAT!!!
I’m glad it’s working!
Can you please tell me what is your version of Linux, and of PHP? I would like to understand better some things that happened in your system.
PHP Version 7.0.25
Linux 2.6.32-773.26.1.lve1.4.35.el6.x86_64 #1 SMP Tue Sep 26 06:34:34 EDT 2017 x86_64
Thanks but that’s your Linux kernel specs, what distro and version is it? Like Ubuntu 16.04 or Debian 7.0, etc?
Try with this command
cat /etc/*-release
Thanks!