• Resolved scarpinoc

    (@scarpinoc)


    Hello,
    I’m testing my website locally using WAMP server v3.2.3
    Everything is update.
    I uploaded the PDF (25 MB, 100 pages) correctly in the media library and the link is:

    https://localhost/002_15ottobre2021/wp-content/uploads/2021/10/PDF_FILENAME_.pdf

    I made an order with WooCommerce, I went to the DOWNLOAD page in my account, click the download button and I have this error:

    Warning: fopen(): remote host file access not supported, file://\wamp64\www\002_15ottobre2021/wp-content/uploads/2021/10/PDF_FILENAME_17875_1634869857.pdf in C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\inc\tcpdf\include\tcpdf_static.php on line 1831

    #	Time	Memory	Function	Location
    1	0.0005	417528	{main}( )	...\index.php:0
    2	0.0008	419064	require( 'C:\wamp64\www\002_15ottobre2021\wp-blog-header.php' )	...\index.php:17
    3	0.0010	419448	require_once( 'C:\wamp64\www\002_15ottobre2021\wp-load.php' )	...\wp-blog-header.php:13
    4	0.0013	420136	require_once( 'C:\wamp64\www\002_15ottobre2021\wp-config.php' )	...\wp-load.php:50
    5	0.0015	421480	require_once( 'C:\wamp64\www\002_15ottobre2021\wp-settings.php' )	...\wp-config.php:87
    6	2.0109	35375440	do_action( )	...\wp-settings.php:578
    7	2.0109	35375816	WP_Hook->do_action( )	...\plugin.php:470
    8	2.0109	35375816	WP_Hook->apply_filters( )	...\class-wp-hook.php:327
    9	2.5699	41977552	WC_Download_Handler::download_product( )	...\class-wp-hook.php:303
    10	2.5992	42252016	apply_filters( )	...\class-wc-download-handler.php:94
    11	2.5992	42252416	WP_Hook->apply_filters( )	...\plugin.php:189
    12	2.5993	42253920	WWPDF_File_Handler->pdf_filepath( )	...\class-wp-hook.php:303
    13	2.6585	50155088	WWPDF_Watermark->__construct( )	...\wwpdf-file-handler.php:90
    14	2.6601	50221176	WWPDF_Watermark->do_watermark( )	...\wwpdf-watermark.php:22
    15	3.2451	85432432	WaterWoo_TCPDI->Output( )	...\wwpdf-watermark.php:69
    16	3.6082	79696792	WaterWoo_TCPDF_STATIC::fopenLocal( )	...\tcpdf.php:7552
    17	3.6082	79696952	fopen ( )	...\tcpdf_static.php:1831

    Could you help me?
    Thank you!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Little Package

    (@littlepackage)

    Hello,

    Thanks for the note. I hope you’re well. Looks like maybe a directory separator issue, but shouldn’t be coming from the plugin. Did you already confirm that PDF downloads work WITHOUT WaterWoo activated? That’s a good place to start, and please let me know.

    Thread Starter scarpinoc

    (@scarpinoc)

    Yes, I did it now: if I disable WaterWoo , PDF can be downloaded with zero problem =)

    Plugin Author Little Package

    (@littlepackage)

    Hi @scarpinoc

    What version of WooCommerce are you using?

    Thread Starter scarpinoc

    (@scarpinoc)

    The last one, everything is up to date 5.8.0.
    Maybe do I need co configure my local XAMP server installation somehow?

    Plugin Author Little Package

    (@littlepackage)

    If you’re willing to try a patch that’s about all I can do for you since I don’t have a way to develop for Windows servers today (or tomorrow…).

    Open waterwoo-pdf/classes/wwpdf-file-handler.php and change line 82 from

    $path = $parsed_file_path['file_path'];

    to

    $path = $file_path;

    See if that works. If that isn’t the solution, I’m not sure I will have anything for you soon. If you come upon a solution, please share, and I will update core!

    Thread Starter scarpinoc

    (@scarpinoc)

    Ok,
    if I change this line, I get this:

    “Unable to watermark this file for download. Please notify site administrator.
    Nessun file definito, Vai al negozio”

    Translation: “No defined file, go to Shop”

    I’m not so good in WordPress to be able to find the solution by myself =)
    I hope the live website will work well =)

    • This reply was modified 3 years, 5 months ago by scarpinoc.
    Plugin Author Little Package

    (@littlepackage)

    @scarpinoc

    If you have WP error logging on you’ll have a more descriptive error there.

    Substituting in $file_path means that we are taking the file path directly from WooCommerce inside a Woo filter, instead of taking it through the Woo method parse_file_path first. If that file path isn’t readable, I’m not sure what else I can do for you. You have a fairly special use case here.

    Thread Starter scarpinoc

    (@scarpinoc)

    Sure, I have,
    how can I send you the debug.log file privately? =)

    Plugin Author Little Package

    (@littlepackage)

    I do not provide email support for free plugins, sorry. YOu should find the lines in the debug.log file that correspond to the TIME when the file download attempt was made. Obscure any identifying information and paste lines here.

    Thread Starter scarpinoc

    (@scarpinoc)

    [22-Oct-2021 02:24:39 UTC] PHP Warning:  fopen(): remote host file access not supported, file://\wamp64\www\002_15ottobre2021/wp-content/uploads/2021/10/XXXX_17875_1634869476.pdf in C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\inc\tcpdf\include\tcpdf_static.php on line 1831
    [22-Oct-2021 02:24:39 UTC] PHP Stack trace:
    [22-Oct-2021 02:24:39 UTC] PHP   1. {main}() C:\wamp64\www\002_15ottobre2021\index.php:0
    [22-Oct-2021 02:24:39 UTC] PHP   2. require() C:\wamp64\www\002_15ottobre2021\index.php:17
    [22-Oct-2021 02:24:39 UTC] PHP   3. require_once() C:\wamp64\www\002_15ottobre2021\wp-blog-header.php:13
    [22-Oct-2021 02:24:39 UTC] PHP   4. require_once() C:\wamp64\www\002_15ottobre2021\wp-load.php:50
    [22-Oct-2021 02:24:39 UTC] PHP   5. require_once() C:\wamp64\www\002_15ottobre2021\wp-config.php:87
    [22-Oct-2021 02:24:39 UTC] PHP   6. do_action() C:\wamp64\www\002_15ottobre2021\wp-settings.php:578
    [22-Oct-2021 02:24:39 UTC] PHP   7. WP_Hook->do_action() C:\wamp64\www\002_15ottobre2021\wp-includes\plugin.php:470
    [22-Oct-2021 02:24:39 UTC] PHP   8. WP_Hook->apply_filters() C:\wamp64\www\002_15ottobre2021\wp-includes\class-wp-hook.php:327
    [22-Oct-2021 02:24:39 UTC] PHP   9. WC_Download_Handler::download_product() C:\wamp64\www\002_15ottobre2021\wp-includes\class-wp-hook.php:303
    [22-Oct-2021 02:24:39 UTC] PHP  10. apply_filters() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\woocommerce\includes\class-wc-download-handler.php:94
    [22-Oct-2021 02:24:39 UTC] PHP  11. WP_Hook->apply_filters() C:\wamp64\www\002_15ottobre2021\wp-includes\plugin.php:189
    [22-Oct-2021 02:24:39 UTC] PHP  12. WWPDF_File_Handler->pdf_filepath() C:\wamp64\www\002_15ottobre2021\wp-includes\class-wp-hook.php:303
    [22-Oct-2021 02:24:39 UTC] PHP  13. WWPDF_Watermark->__construct() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\classes\wwpdf-file-handler.php:90
    [22-Oct-2021 02:24:39 UTC] PHP  14. WWPDF_Watermark->do_watermark() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\classes\wwpdf-watermark.php:22
    [22-Oct-2021 02:24:39 UTC] PHP  15. WaterWoo_TCPDI->Output() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\classes\wwpdf-watermark.php:69
    [22-Oct-2021 02:24:39 UTC] PHP  16. WaterWoo_TCPDF_STATIC::fopenLocal() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\inc\tcpdf\tcpdf.php:7552
    [22-Oct-2021 02:24:39 UTC] PHP  17. fopen() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\inc\tcpdf\include\tcpdf_static.php:1831
    [22-Oct-2021 02:24:39 UTC] PHP Warning:  fopen(file://\wamp64\www\002_15ottobre2021/wp-content/uploads/2021/10/XXXXXXXXXX_17875_1634869476.pdf): failed to open stream: no suitable wrapper could be found in C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\inc\tcpdf\include\tcpdf_static.php on line 1831
    [22-Oct-2021 02:24:39 UTC] PHP Stack trace:
    [22-Oct-2021 02:24:39 UTC] PHP   1. {main}() C:\wamp64\www\002_15ottobre2021\index.php:0
    [22-Oct-2021 02:24:39 UTC] PHP   2. require() C:\wamp64\www\002_15ottobre2021\index.php:17
    [22-Oct-2021 02:24:39 UTC] PHP   3. require_once() C:\wamp64\www\002_15ottobre2021\wp-blog-header.php:13
    [22-Oct-2021 02:24:39 UTC] PHP   4. require_once() C:\wamp64\www\002_15ottobre2021\wp-load.php:50
    [22-Oct-2021 02:24:39 UTC] PHP   5. require_once() C:\wamp64\www\002_15ottobre2021\wp-config.php:87
    [22-Oct-2021 02:24:39 UTC] PHP   6. do_action() C:\wamp64\www\002_15ottobre2021\wp-settings.php:578
    [22-Oct-2021 02:24:39 UTC] PHP   7. WP_Hook->do_action() C:\wamp64\www\002_15ottobre2021\wp-includes\plugin.php:470
    [22-Oct-2021 02:24:39 UTC] PHP   8. WP_Hook->apply_filters() C:\wamp64\www\002_15ottobre2021\wp-includes\class-wp-hook.php:327
    [22-Oct-2021 02:24:39 UTC] PHP   9. WC_Download_Handler::download_product() C:\wamp64\www\002_15ottobre2021\wp-includes\class-wp-hook.php:303
    [22-Oct-2021 02:24:39 UTC] PHP  10. apply_filters() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\woocommerce\includes\class-wc-download-handler.php:94
    [22-Oct-2021 02:24:39 UTC] PHP  11. WP_Hook->apply_filters() C:\wamp64\www\002_15ottobre2021\wp-includes\plugin.php:189
    [22-Oct-2021 02:24:39 UTC] PHP  12. WWPDF_File_Handler->pdf_filepath() C:\wamp64\www\002_15ottobre2021\wp-includes\class-wp-hook.php:303
    [22-Oct-2021 02:24:39 UTC] PHP  13. WWPDF_Watermark->__construct() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\classes\wwpdf-file-handler.php:90
    [22-Oct-2021 02:24:39 UTC] PHP  14. WWPDF_Watermark->do_watermark() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\classes\wwpdf-watermark.php:22
    [22-Oct-2021 02:24:39 UTC] PHP  15. WaterWoo_TCPDI->Output() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\classes\wwpdf-watermark.php:69
    [22-Oct-2021 02:24:39 UTC] PHP  16. WaterWoo_TCPDF_STATIC::fopenLocal() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\inc\tcpdf\tcpdf.php:7552
    [22-Oct-2021 02:24:39 UTC] PHP  17. fopen() C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\inc\tcpdf\include\tcpdf_static.php:1831
    [22-Oct-2021 02:24:39 UTC] WaterWoo (TCPDF) ERROR: Unable to create output file: \wamp64\www\002_15ottobre2021/wp-content/uploads/2021/10/XXXXXXXXXX_17875_1634869476.pdf
    [22-Oct-2021 02:26:39 UTC] PHP Warning:  fopen(): remote host file access not supported, file://\wamp64\www\002_15ottobre2021/wp-content/uploads/2021/10/XXXXXXXXXX_17875_163486947.pdf in C:\wamp64\www\002_15ottobre2021\wp-content\plugins\waterwoo-pdf\inc\tcpdf\include\tcpdf_static.php on line 1831
    Plugin Author Little Package

    (@littlepackage)

    OK, thanks. PHP fopen() doesn’t like unescaped backslashes.

    How is the PDF URL/abspath entered into the WooCommerce product settings?

    Thread Starter scarpinoc

    (@scarpinoc)

    Ahh… You are right!

    https://localhost/002_15ottobre2021/wp-content/uploads/2021/10/xxxxxxx_2°_Edition.pdf

    If I change to:
    https://localhost/002_15ottobre2021/wp-content/uploads/2021/10/xxxxxxx_2nd_Edition.pdf

    The problem was “°” symbol…

    Now I don’t see any error. But I have this message:
    The free version of WaterWoo cannot serve PDFs from remote servers.
    Try uploading your PDF product to this domain using the native WooCommerce file uploader.
    Ehhmm.. Why this message? I’m working locally =) and the file IS on localhost

    Plugin Author Little Package

    (@littlepackage)

    Hi @scarpinoc,

    I’ve made some changes in 2.7.11 that might help you as far as the Windows file paths and PHP fopen().

    As far as this:

    The free version of WaterWoo cannot serve PDFs from remote servers.
    Try uploading your PDF product to this domain using the native WooCommerce file uploader.

    It means what it says. Was your PDF uploaded with the WooCommerce file product uploader on the product edit page (e.g. via the Media uploader)? You say the file IS on localhost but — it needs to be in the woocommerce_uploads folder.

    Thread Starter scarpinoc

    (@scarpinoc)

    Now it works =)
    Thank you!

    Plugin Author Little Package

    (@littlepackage)

    @scarpinoc I really appreciate you taking the time to let me know. I’ve closed this support topic, and hope you can take the time to leave a review.
    Take best care!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Many PHP errors using WAMP’ is closed to new replies.