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

230
Visualizações
php curl throws 503 on HTTPS but works on HTTP

I am running joomlatools-box and trying to execute curl on a https site which throws 503. If I try it on a http site it works perfectly. I suspect something is wrong in my ubuntu vagrant box or that a proxy is in the way but cannot really figure out how to resolve this.

Trying the following code does not work will result in 503 Service Unavailable:

$ch = curl_init('https://example.com');
curl_setopt($ch ,CURLOPT_RETURNTRANSFER,true);
$ret = curl_exec($ch);
curl_close($ch);
var_dump($ret);
die();

The code below works and returns the contents of the site:

$ch = curl_init('http://example.com');
curl_setopt($ch ,CURLOPT_RETURNTRANSFER,true);
$ret = curl_exec($ch);
curl_close($ch);
var_dump($ret);
die();

EDIT: Running php 7.2.27, curl version:

$ curl --version
curl 7.70.0-DEV (x86_64-pc-linux-gnu) libcurl/7.70.0-DEV OpenSSL/1.1.1d zlib/1.2.11 libssh2/1.9.0
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets
over 4 years ago · Santiago Trujillo
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