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 AppConsole;
use IlluminateConsoleSchedulingSchedule;
use IlluminateFoundationConsoleKernel 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.
As well adding ini_set('date.timezone', 'Europe/Zagreb');
to artisan
file itself.
No joy with any of that. Does anyone have any suggestions?