Allright, it seems, that running the php artisan optimize is very important to clear the app cache to avoid such issues So for those who cannot do so, will face such trouble like an issues on generating pdf. For those who cant, might want to try first raise a ticket to hosting tech team. You didnt need to go into too many details, just said as per below;
Hi Support, im just installed Invoice Ninja v5 into the server, and after some configuration, it needed me to run the below command to get the result of the configuration, can you assist?
command needed : php artisan optimize
Documentation; Free Open-Source Invoicing, Expenses & Time-Tracking | Invoice Ninja
Usually they wont asked many question and just do it for you, but in some cases if these failed, then the below might be temporary solution for you.
Disclaimer: Im not an expert nor pro, so i cant say that this will solve your issues and permanently solved it, but in my case, atleast until this time of comment, my pdf has worked as intended. And also please take note, im white label user, which means i purchased the 1 year subscription license as such i didn’t try on default phantomJS configuration. Try at your own risk.
First as a white lable user, i follow this step to disable phantom JS and use self hosted Ninja_hosted_PDF in the /.env file on the invoiceninja root directory. But this changes seems not reflecting or somehow didnt update the cache. Which means the pdf request kept requesting from phantomjs instead ninja_hosted_pdf.
So as i said, i cant run the php artisan optimize command due to server limitation, because of that i highly suspect that its a cache issues. So i found on this site about laravel caching storage discussion php - Laravel 5.3 - Clear config cache in shared hosting - Stack Overflow
So it seems laravel save a cache of its config here: /bootstrap/cache/config.php
inside it you can search for these line:
‘phantomjs_pdf_generation’ => true,
‘invoiceninja_hosted_pdf_generation’ => false,
which DID NOT reflect my settings on /.env so what i do is i simply change phantomjs to false and hosted pdf to true as per below
‘phantomjs_pdf_generation’ => false,
‘invoiceninja_hosted_pdf_generation’ => true,
And my pdf generator worked as it should be. Alhamdulillah. But again, as i no expert, i dont know if this manual settings gonna stay or will change because of maybe this way is improper way of doing it and might get rewritten by the system or something later on. But for the time being, its working, and i also try looked into another hoster that can offer me assistance on doing this php artisan command thingy.
Not forgotten too, Thanks to @hillel @david for the help you guys do and built the wonderful products