Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

302
Vistas
getimagesize / fopen connection refused

I am trying to get the size from an remote image with the native php function getimagesize from an absolute URL. I am using PHP 7.3, here is the code:

$fichier = 'http://mydomain/images/image.jpg';
$size = getimagesize($fichier);
var_dump($size);

And the code return :

PHP Warning: getimagesize(http://mydomain/images/image.jpg): failed to open stream: Connection refused in ...

And with fopen, same problem:

PHP Warning: fopen(http://mydomain/images/image.jpg): failed to open stream: Connection refused 

And when I am trying the same URL from an other server, it is working.

Also, if I am trying to get infos from an other image and from an other domain but on the same server, it is not working also.

allow_url_fopen is enabled. I think that it should come from Apache conf, but not sure... Anybody has an idea ? Thanks !

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Finally, the problem is coming from the network. Apache could not resolve his own public domain name. So to correct the problem, I just had " 127.0.0.1 mydomain" in the hosts file, and the problem was solved. Hope it can help !

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda