I am using Laravel 10.x and I am running artisan command using Cronjob /opt/alt/php82/usr/bin/php artisan schedule:run >/dev/null 2>&1 every minute as follows:
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
$schedule->command('emails:send-scheduled')->everyMinute();
$schedule->command('emails:send-order-reminder')->everyFiveMinutes();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
And commands are executed just fine. But I warning is logged in error_log file
PHP Warning: PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0
I have configured timezone (Europe/Zagreb) in app settings and correct time is shown across the app. It's just when ever artisan is exexuted it's not picking up timezone and warning is logged.
I am running app on cPanel and I have already tried with setting timezone in htaccess file and as well creating php.ini files to override it.
I have tried adding ini_set('date.timezone', 'Europe/Zagreb'); to artisan and different files to force timezone but no joy.
Does anyone have any suggestions?
php artisan config;cacheto see if that helpedconfig/app.phpcan lead to this warning message. Can you confirm it is in the list of supported timezones at php.net/manual/en/timezones.php ?'timezone' => 'Europe/Zagreb',