You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have a strange error in my cron job. At the beginning while I am running the cron job its working fine. At that time I am define the variables normally. Like, $ck_host='abc';. But now I change the code and access the same variable from the .env file of laravel. Like, $ck_host=$_ENV['CK_HOST'];. When I am running in my browser it works fine. But in the cron job, it says undefined index: CK_HOST. I have attach the image of the log.
Note: I am using vlucas/phpdotenv for access env file.
Thanks in advance for help.
The text was updated successfully, but these errors were encountered:
The some of corn file code written in Core PHP others in Laravel. So I for the core PHP files for access env file I added that vendor. I am using Artisan to call. When I am using static variable its fine, when I try to access env file of laravel then problem comes. I didn't able to understand why the error is coming? If I run that url in my browser there is no problem only happens in cron.
If you call a Artisan command, not alle features are available. For further information about Artisan and Laravel please have a look at the source code or open a question on Stack Overflow or the Laravel GitHub repository. If you want to use the envoironment option with Artisan please have a look at my last reply and use one of the two options (add the environment option when calling artisan commands or use Cron's integrated route).
Hi,
I have a strange error in my cron job. At the beginning while I am running the cron job its working fine. At that time I am define the variables normally. Like,
$ck_host='abc';
. But now I change the code and access the same variable from the .env file of laravel. Like,$ck_host=$_ENV['CK_HOST'];
. When I am running in my browser it works fine. But in the cron job, it saysundefined index: CK_HOST
. I have attach the image of the log.Note: I am using vlucas/phpdotenv for access env file.
Thanks in advance for help.
The text was updated successfully, but these errors were encountered: