On the production server, there is the queue:listen process running with supervisor.
So that's it, when we ssh into the server, and if we run php -i , we can see the $_SERVER variables were loaded, even as blank.
When the php command is run via supervisor, there is no $_SERVER variables.
So the solution to get DOMPDF working within the queue processed by supervisor, is to workaround the code. if you have it through composer, like me, it will be a pain, forking the repository, and changing the source in composer.json
Then, all we have to do is working the logs until all environemnt variables are met, through
if (!issset($_SERVER["SCRIPT_FILENAME"])) $_SERVER["SCRIPT_FILENAME"] = "";
This will make it work, as it does when running through SSH, that's how it loads the vars, empty!
Hope this helps anyone!!
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us