How do you enable web cron?
I’ve added the webcron WEBCRON_SECRET=password
to the env. file and then I ran the web cron:
https://domain.com/webcron?secret=mykey
.
But that results in this error message:
{"message":"Web cron has not been configured"}
So what am I missing here?
Thanks in advance.
Kind regards
`
hillel
June 26, 2021, 6:40pm
2
Hi,
Maybe you need to run php artisan optimize
after changing the .env file
@david do you have any suggestions?
1 Like
david
June 26, 2021, 8:43pm
3
@hillel correct, looks like the .env var isn’t being read - so an optimize should fix this.
1 Like
i did try that and this is what happens:
Do I need to add the full path to the installation?
Kind regards
AngryWarrior:
Enable web cron?
Right, i figured it out. Added the path and suddenly the “magic” was there.
Thanks a bunch guys!
Kind regards
AngryWarrior
Hmm cron jobs are still falling?
Now I really do not know what to do…
I set up the web cron because the normal cron jobs didn’t seem to work properly.
So what do to now?
Kind regards
Nevermind I got it to work…
freebs
July 15, 2021, 6:56pm
8
What did you do ? it’d be nice to see what others do to fix errors…
Hello @freebs
In the env config file in your web root you need you add this line:
https://domain.com/webcron?secret=mykey
.
where my key is altered to a secure secret key.
Then login to your server and open your Linux command prompt, cd to your ninja installation folder and type:
sudo php artisan optimize
This will optimize the file and force it to be re-read by Invoice Ninja system.
The you need to set up the webcron. I suggest you use a cron service as described here: I found this cool site for running cron-jobs for free. | Business, Marketing & SEO Forums
which is also free to use.
Now in that cron job you add the address and secret key to be called by the cron:
https://domain.com/webcron?secret=mykey
and if you see it being called successfully then you know you it is working…
Cheers!
AngryWarrior.
2 Likes
@AngryWarrior - Thanks! Does above webcron gets rid of CRONS NEED TO BE ENABLE warning within InvoiceNinja v5?
Just do what I have done above in this forum thread and it will work…
Kind regards
AngryWarrior