Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running on Windows using the built-in PHP web server, external links such as images or CSS stylesheets do not load. #506

Open
vahiddabbagh opened this issue Apr 26, 2023 · 2 comments

Comments

@vahiddabbagh
Copy link

vahiddabbagh commented Apr 26, 2023

Hi,

This issue only occurs when running Laravel under the built-in PHP development server. When using php artisan serve, the problem does occur. Accessing the website from Apache or Nginx web servers does not cause any problems. Is there a solution to fix this issue?

@vahiddabbagh
Copy link
Author

After several days of rigorous code review and testing, I have discovered that I needed to include the "SystemRoot=C:\WINDOWS" environment variable in the snappy config file. With this addition, any external links or images are now properly rendered in the generated PDF.

I am uncertain about the root cause of this issue. I hope the package author can identify and implement a more effective solution.

'pdf' => [
'enabled' => true,
'binary' => env('WKHTML_PDF_BINARY', 'wkhtmltopdf'),
'timeout' => false,
'options' => [],
'env' => [
'SystemRoot' => 'C:\WINDOWS'
],
],

@GeraZgVic
Copy link

Excelent, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants