Cron Job Issue

Hi, everybody!

Some one knows why my cron.php not run under php5.6.38 but this is running without problems under php5.4.x

I have SuiteCRM 7.9.4 and I’d like let it running under php5.6.38… but the problem is the cron…

Does any error show in your logs?

Hi!!! @pgr

I ran manually the command and i see the log and showed me this:

Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] current_language is: en_us
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCacheMemcache
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCacheAPC
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCacheMemory
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Using cache backend SugarCacheMemory, since 999 is less than 1000
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCacheFile
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCacheWincache
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCacheZend
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCacheMemcached
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCachesMash
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Found cache backend SugarCacheRedis
Tue Sep 5 23:17:41 2017 [18112][-none-][INFO] Found language file: en_us.lang.php
Tue Sep 5 23:17:41 2017 [18112][-none-][INFO] Found extended language file: en_us.lang.ext.php
Tue Sep 5 23:17:41 2017 [18112][-none-][INFO] Found custom language file: en_us.lang.php
Tue Sep 5 23:17:41 2017 [18112][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone=“UTC” in php.ini!
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Hook called: ::server_round_trip
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Including module specific hook file for custom/modules
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Including Ext hook file for custom/application
Tue Sep 5 23:17:41 2017 [18112][-none-][DEBUG] Calling MySQLi::disconnect()

I checked the php.ini and the date.timezone is equaled to America/Los_Angeles, I don’t know what’s happening :frowning:

i compared the php.ini under php 5.6.x and the php.ini under php 5.4.x and the date.timezone is the same America/Los_Angeles :S

There are two different php.ini that apply.

Read the section titled “What php.ini settings apply to the cron jobs?” in this article:

https://pgorod.github.io/Scheduler-Jobs/

Hi @pgr!

I ran locate php.ini
and the result was this:

/etc/php/7.0/apache2/php.ini
/etc/php/7.0/cli/php.ini
/etc/php/7.0/fpm/php.ini
/etc/php/7.1/apache2/php.ini
/etc/php/7.1/cli/php.ini
/opt/bitnami/php/etc/php.ini <---------------------------------------- this is the good i guess…
/opt/bitnami/php00/etc/.php.ini.swp
/opt/bitnami/php00/etc/php.ini
/usr/lib/php/7.0/php.ini-development
/usr/lib/php/7.0/php.ini-production
/usr/lib/php/7.0/php.ini-production.cli
/usr/lib/php/7.1/php.ini-development
/usr/lib/php/7.1/php.ini-production
/usr/lib/php/7.1/php.ini-production.cli

what could i do? :S

Bitnami is a peculiar installation, I see there’s a section titled “How to modify PHP settings” here:

https://docs.bitnami.com/installer/apps/suitecrm/

… but they don’t seem to mention the CLI.

Just use

php -i | grep php.ini

from the command-line, that will tell you the CLI php.ini directly.

Hi @pgr!!

I ran the command php -i | grep php.ini

the result was:…

Configuration File (php.ini) Path => /usr/local/lib

then… in theory my cronjob command should be some like this? :
var $possiblePath = /opt/bitnami/php/etc/php.ini <=== this is the good i guess…

          • su daemon -s /usr/local/lib -c “cd /opt/bitnami/apps/suitecrm/apps/suitecrm/htdocs; ***what path here ???/php/bin/php -f cron.php > /dev/null 2>&1”

We’re not talking about your cron job command; if it giving timezone errors in the logs, then it is already running well.

We’re talking about setting the correct timezone, that would be in

/usr/local/lib/php.ini

set date.timezone to whatever is the correct value for you. This should make the errors in the log go away.

But I find that path strange, it just doesn’t sound right to me… still, try setting the timezone there and then check suitecrm.log again for those FATAL errors.

I ran the command manually

      su daemon -s /bin/sh -c "cd /opt/bitnami/apps/suitecrm/htdocs; /opt/bitnami/php/bin/php -f cron.php > /dev/null 2>&1"

and the log file does not show yet the [-none-][FATAL] error…

just show this:

Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] current_language is: en_us
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCacheMemcache
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCacheAPC
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCacheMemory
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Using cache backend SugarCacheMemory, since 999 is less than 1000
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCacheFile
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCacheWincache
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCacheZend
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCacheMemcached
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCachesMash
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Found cache backend SugarCacheRedis
Thu Sep 7 08:16:17 2017 [1566][-none-][INFO] Found language file: en_us.lang.php
Thu Sep 7 08:16:17 2017 [1566][-none-][INFO] Found extended language file: en_us.lang.ext.php
Thu Sep 7 08:16:17 2017 [1566][-none-][INFO] Found custom language file: en_us.lang.php
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Hook called: ::server_round_trip
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Including module specific hook file for custom/modules
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Including Ext hook file for custom/application
Thu Sep 7 08:16:17 2017 [1566][-none-][DEBUG] Calling MySQLi::disconnect()

but… I go to Admin > schedulers > PROCESS WORKFLOW TASKS but the job log subpanel is empty… :frowning:

Please try this one

/opt/bitnami/php/bin/php -i | grep php.ini

this way we’ll be sure it’s the same php executable. When it gives you the path of the php.ini, tell me what setting you have in date.timezone inside that file.

When I ran the command :
/opt/bitnami/php/bin/php -i | grep php.ini
the console showed me this:
Configuration File (php.ini) Path => /usr/local/lib
but into that path, not there are the php.ini…
ls -l /usr/local/lib
total 8
drwxrwsr-x 4 root staff 4096 Jan 22 2015 python2.7
drwxrwsr-x 3 root staff 4096 Jan 22 2015 python3.4
is all are in that path :S

but… the php.ini that o guess is running are is on /opt/bitnami/php
and the date.timezone = “America/Los_Angeles”

Yeah that doesn’t sound right at all.

What exactly is your timezone, UTC?

Why don’t you just go into EVERY php.ini file in your system and set that?