chrome-php / chrome

Instrument headless chrome/chromium instances from PHP
MIT License
2.2k stars 269 forks source link

Print on MacOs using php local server: timeout #616

Closed numediaweb closed 2 months ago

numediaweb commented 3 months ago

Hey There,

I am running the package with Symfony 6.4 using the local PHP server php -S localhost:8000 but it always returns timeout not matter what.. If I try to print http://example.com it prints successfully.

Is there any way to debug what's going on the background? Does it even work with local PHP server?

Thanks!

enricodias commented 3 months ago

Check the logs, either in the terminal you are running your php server or in the error log. You can also remove the headless option to see if a browser window opens when you execute your code.

numediaweb commented 2 months ago

The issue is related to the css files used on the printed page: I had to make them inline in order to be able to print... Seems chrome takes time to load those css files. I used https://templates.mailchimp.com/resources/inline-css/ to make the css files inline and that did the trick :)