-
Notifications
You must be signed in to change notification settings - Fork 18
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
on managed hosting, pdfs return blank even though file_get_contents, curl, and permissions are ok #36
Comments
Wow, have to admit I’m a bit surprised this code is still being used 😊 if I remember correctly I saw this issue when the /pdf-{preview,render} route was inaccessible from the host itself. i think the plugin literally makes a http call to query the endpoint, so if the endpoint is behind auth or similar, it will fail. Might also want to check that you can read and write files in /tmp. Are you able to turn on error logging on the host so you see any possible issues? |
Thanks for the reply!
Yes error logging is on and attached in the first message if you feel like looking at it.
Basically can’t hit local host. But the error messages are about the 2 first attempts (the code tries to hit the content 3 times and eventually pings the permalink directly.
…
--
Kaz
… On Nov 26, 2021, at 8:10 AM, Viljami Kuosmanen ***@***.***> wrote:
Wow, have to admit I’m a bit surprised this code is still being used 😊
if I remember correctly I saw this issue when the /pdf-{preview,render} route was inaccessible from the host itself.
i think the plugin literally makes a http call to query the endpoint, so if the endpoint is behind auth or similar, it will fail.
Might also want to check that you can read and write files in /tmp.
Are you able to turn on error logging on the host so you see any possible issues?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Address not available sounds like I would experiment with changing this line to point to either to public address or |
thanks for the reply! nah, i am still troubleshooting and i get further.
this is the error i get. it's just a warning. and then the PDF is blank. any ideas? |
Sorry, beyond that it's hard to say. To troubleshoot, maybe add some logging and check if you're getting the right html at: https://github.com/anttiviljami/wp-pdf-templates/blob/master/wp-pdf-templates.php#L260 |
yeah... i do. i have one last question man, if you can: how do I specify a
tmp folder for the PDF to be generated? i think the last thing I need to
check before switching hosting... there seems to be a slew of options in
dompdf.
…On Sat, Nov 27, 2021 at 4:27 PM Viljami Kuosmanen ***@***.***> wrote:
Sorry, beyond that it's hard to say.
To troubleshoot, maybe add some logging and check if you're getting the
right html at:
https://github.com/anttiviljami/wp-pdf-templates/blob/master/wp-pdf-templates.php#L260
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFMLHRLT4KPQHWDYIXHGUDUOD2EJANCNFSM5IZQDOKA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
ok - i was able to troubleshoot further. this is the error i get now:
does that make sense to you? |
@anttiviljami hi - i know this is not your main gig and that you don't use this much these days.
i have spent tons of time trying to solve this issue.
i read all the forums posts on WP, and a lot of stackoverflows about this.
i have this working just fine on a VPS, on several websites, with the same hosting company (MT), exact same code.
on MANAGED HOSTING, the PDF returns blank. the error logs show nothing I can solve:
errors.zip
errors.log
i was told by the hosting's support that this can't work on this type of hosting, but i didn't believe it since file_get_content works, curl works, and i actually managed to generate a pdf with this test file:
...going around all the Wordpress stuff found in the actual plugin.
the result is very close the functioning one we have on our dev server, but only if i try to read from -template, from -preview it fails.
test123f.pdf (16).pdf
what i am asking is this:
if anybody has any insight on how to solve this, i would be grateful. i tried swapping dompdf versions, i tried outputting just the default template that comes with the plugin, i tried debugging verbosely... (by the way, how to get the same output as the debugger found on http://eclecticgeek.com/dompdf/debug.php ? the one that shows dependencies? i wasn't able to do that
i am able to generate basic pdfs with just things like "hello world" — what fails is when i try to read content from an html.
if anybody has had experience with that and solved it, i am willing to try your solution!
my guess is that the managed hosting restrictions prevent from reading or writing the temp file
i have to disable cache to make my test work, and the font cache folder never gets the .inc file or the font files.
happy to jump on a discord if you want to check this out with me, i am totally stuck.
thanks!
The text was updated successfully, but these errors were encountered: