• Resolved danishmuneer

    (@danishmuneer)


    I installed on my website and when I click on download button on the cart, it opens another tab but with a 500 error. I see the following message in the nginx error log:

    Just FYI I replaced the website URL with xxx for privacy.

    I tested on my local and everything was working fine. All folders on the server have 755 permissions which is standard.

    Please help as I was really looking forward to using this plugin

    2024/01/10 05:42:24 [error] 782728#782728: *374130 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Mpdf\MpdfException: Temporary files directory "/var/www/xxx/htdocs/wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Config/../../tmp/mpdf" is not writable in /var/www/xxx/htdocs/wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Cache.php:21
    Stack trace:
    #0 /var/www/xxx/htdocs/wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/ServiceFactory.php(67): Mpdf\Cache->__construct()
    #1 /var/www/xxx/htdocs/wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Mpdf.php(1084): Mpdf\ServiceFactory->getServices()
    #2 /var/www/xxx/htdocs/wp-content/plugins/wc-cart-pdf/wc-cart-pdf.php(120): Mpdf\Mpdf->__construct()
    #3 /var/www/xxx/htdocs/wp-includes/class-wp-hook.php(310): wc_cart_pdf_process_download()
    #4 /var/www/xxx/htdocs/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 /var/www/xxx/htd" while reading response header from upstream, client: 2607:fea8:fe40:7ab6:8002:d0ee:b998:69f4, server: xxx.com, request: "GET /cart/?cart-pdf=1&_wpnonce=47bbd38389 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php81-fpm-xxx.com.sock:", host: "www.xxx.com", referrer: "https://www.xxx.com/cart/"
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter danishmuneer

    (@danishmuneer)

    Btw I do not see any folders inside the Config folder: here is a screenshot cart-pdf-error.png

    One thing to note is that I didn’t “install” the plugin through the WordPress plugin directory. I uploaded the plugin folder through FTP and just activated the plugin. Can that cause any issues?

    • This reply was modified 2 years, 5 months ago by danishmuneer.
    • This reply was modified 2 years, 5 months ago by danishmuneer.
    Plugin Author David Jensen

    (@dkjensen)

    Hello

    Could you try placing the following PHP code snippet in your child theme functions.php file or similar?

    add_filter( 'wc_cart_pdf_mpdf_args', function( $args ) {
    	$args['tempDir'] = get_temp_dir();
    	
    	return $args;
    } );
    Thread Starter danishmuneer

    (@danishmuneer)

    This fixed the issue. Big thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Error with MPDF/MpdfException: Not writable’ is closed to new replies.