0

With the same code on two different web server I found two different results ! I use PHP7.3 fpm on both.

The file path is something like

"http://fitantanana/viewimage.php?modulepart=medias&entity=1&file=image/test_Exemple_doc.png"

On the server returning an error, the PHP error log contains

"PHP Warning:  imagecreatefrompng(http://fitantanana/viewimage.php?modulepart=medias&entity=1&file=image/test_Exemple_doc.png): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in ..."

As you can see, the requested URL has been change : all the characters & have become &.

Thanks in advance for your ideas.

Best regards, Sylvain Legrand.

ADyson
  • 57,178
  • 14
  • 51
  • 63
  • sorry , I cannot see where & changed to & –  May 20 '20 at 21:45
  • The error says "*...getaddrinfo failed: Temporary failure in name resolution in ...*". So that tells you there was a network error requesting the remote image. Maybe it was temporary, or maybe `http://fitantanana/` does not resolve from that host. There are many reasons your code could work in one place, but not another, for eg different network configuration on the server, different PHP configuration. – Don't Panic May 21 '20 at 00:14
  • I made some tests. The problem comes with the change I highlighted. On the server with wrong results if I test the original URL, it works. My question is why when passing a URL to the imagecreatefrompng () function this function changes this URL. – Sylvain Legrand May 21 '20 at 12:33

0 Answers0