Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

301
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda