Support the ongoing development of Laravel.io →
Queues Jobs Configuration
Last updated 2 years ago.
0

Got it!!

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!!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

iboinas iboinas Joined 11 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.