Warning: fopen(): remote host file access not supported [my file… ] in C:\xampp\htdocs\wordpress\wp-content\plugins\waterwoo-pdf\inc\tcpdf\include\tcpdf_static.php on line 1859
Hi there @pierregofu and thanks for your message. I’d like to address the first part of your message with the “Warning” above because I think it answers the question: Your PDF must be hosted on the same server as your WP installation. The free version of this plugin has no provision for accessing files on remote servers. I hope this makes sense!
Hi, thanks for your answer. Actually everything is hosted on my computer at the moment, the website and the pdf I want to download from this website.
The pdf file is in xampp/htdocs/wordpress/wp-content/uploads/woocommerce_uploads, so necessarily on the same server.
I also tried something I read on stackoverflow : on line 1859 in tcpdf_static.php, I wrote
return fopen($_SERVER[‘DOCUMENT_ROOT’].$filename, $mode);
instead of
return fopen($filename, $mode);
Then I just get this error message :
Warning: fopen(C:/xampp/htdocs/file://\xampp\htdocs\wordpress/wp-content/uploads/woocommerce_uploads/2020/06/Lucius-Le-mur-dhadrien_312_1601653690.pdf): failed to open stream: No such file or directory in C:\xampp\htdocs\wordpress\wp-content\plugins\waterwoo-pdf\inc\tcpdf\include\tcpdf_static.php on line 1859
I don’t understand much about this.
Thanks for your help
file://\xampp\htdocs\wordpress/wp..
Interesting the mix of forward and back slashes..
I assume you have listed the absolute path of the file in the Woo product settings?
Please keep in mind, once you start changing TCPDF code and WaterWoo code, I cannot help as it’s not collaborative and I’ve lost bearing.
-
This reply was modified 5 years, 8 months ago by
Little Package. Reason: blockquote quoted code
I assume you have listed the absolute path of the file in the Woo product settings?
Hmmmmm yes I wrote the absolute path… So now I’ve changed it to relative and it works. Sorry I’m quite a newbie.
It also makes me remember that I’ll have a problem with absolute paths when migrating the website to a real host.
Please keep in mind, once you start changing TCPDF code and WaterWoo code, I cannot help as it’s not collaborative and I’ve lost bearing.
Precisely I asked for help because I don’t want to change anything in the code.
Thanks for you help.
Hi @pierregofu
Did you get this working? I know that WooCommerce accepts absolute paths and URLs for its products, and that the free version of WaterWoo will accept files hosted under the same domain as the WooCommerce installation. I’m not sure why relative path worked in this case, but if it did and you’re happy with that – great!