I see the red [X] appear when on versions of PHP higher than 5.5.38. I recently changed my MAMP install to PHP version 5.6.31 and the images were no longer showing. I switched back to 5.5.38 and also tried 5.4.45 and the images are showing again.
When I was debugging in PHP version 5.6.31 using the $mpdf->showImageErrors = true;
method above, I received the following error:
“mPDF error: IMAGE Error (//localhost:3000/wp-content/uploads/2017/10/logo-jsslaw-all-gray.png): Could not find image file”
I tried replacing the src="<?php echo $pdf_header_image_attachment[0];?>"
in the dkpdf-header.php file to the relative path of the image (no //localhost:300) and still no luck. I confirmed it was in the uploads folder under the correct path. I assume it would not work for previous versions of PHP if the path was incorrect.
Is there a “best practice” in terms of what PHP version we should be using to ensure DK PDF’s best performance?
Also, if the following method brought up by @justtryit87 is the correct solution, where does the code below need to be placed?
$siteURL = get_site_url()."/";
$imgurl = get_the_post_thumbnail_url();
$imgurlonly = str_replace($siteURL,"",$courseImg);
Thank you in advance! This is a great plugin!