mPDF not rendering images (mPDF error: IMAGE Error Could not find image file)

后端 未结 6 1364
执笔经年
执笔经年 2020-12-17 22:39

We are getting plagued with this which started in April on working server. Everything was fine with our application until the customer reported that PDFs were no longer dis

6条回答
  •  悲哀的现实
    2020-12-17 23:23

    I ran across this issue today. My problem was that the domain name I was using didn't resolve back to the server when accessed from the server. I added an entry to the hosts file on the server, and images started showing.

    Your equivalent hosts file entry of what fixed my problem would be:

    127.0.0.1 www.aibsonline.co.uk
    

    Or otherwise ensure that www.aibsonline.co.uk resolves to your server in the DNS that your server uses.

    It appears that mPDF accesses images as a cURL web client, so DNS on the server needs to be configured correctly to refer back to itself.

提交回复
热议问题