3

When generating a PDF using mpdf I get the error:

mPDF error: IMAGE Error (https://mywebsite.com/images/foo.png): Could not find image file

This post says that its a internal domain resolution error. I know its an internal server domain resolution issue because if I place that above image url into my browser the image appears.

So I have done the advice in the above post and added my domain to /etc/hosts but it still doesn't work.

What do I need to configure on my Cent OS 6.8 VPS to resolve these urls internally? Maybe I need to restart some services on the server to enable the change?. My server is with GoDaddy and all of the below was already in the file. I just added mywebsite.com to 127.0.0.1.

127.0.0.1               localhost.localdomain localhost mywebsite.com
::1             localhost localhost.localdomain localhost6 localhost6.localdomain6
XX.XX.XXX.222           mywebsite.com sXXX-XXX-XX-71.secureserver.net sXXX-XXX-XX-71 ip-XX-XX-XXX-222.ip.secureserver.net ip-XX-XX-XXX-222
XXX.XXX.XX.71           mywebsite.com

For context; The PDF is built from a HTML template that has images in it. The image urls are in the format src="/images/foo.png".

Community
  • 1
  • 1
sazr
  • 24,984
  • 66
  • 194
  • 362

1 Answers1

3

use src="image/foo.png" instead of src="/image/foo.png" helped me

Stan Fad
  • 1,124
  • 12
  • 23