Answer the question
In order to leave comments, you need to log in
Problem getting image content - PHP Warning: getimagesize?
Hello, I
have a clean virtual machine with Ubuntu 16 and an image like: https://img1.goodfon.ru/wallpaper/big/1/ca/foto-ma... Image uploader
always returns warning:
PHP Warning: getimagesize( https: //img1.goodfon.ru/wallpaper/big/1/ca/foto-ma... failed to open stream: HTTP request failed! in Command line code on line 1
bool(false)
Can be reproduced like this:
php -r 'echo var_dump(getimagesize("https://img1.goodfon.ru/wallpaper/big/1/ca/foto-makro-kartinka-zelenye.jpg"));'
curl -v https://img1.goodfon.ru/wallpaper/big/1/ca/foto-makro-kartinka-zelenye.jpg
Answer the question
In order to leave comments, you need to log in
<?php
$ch = curl_init("https://img1.goodfon.ru/wallpaper/big/1/ca/foto-makro-kartinka-zelenye.jpg");
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_exec($ch);
curl_close($ch);
...
> GET /wallpaper/big/1/ca/foto-makro-kartinka-zelenye.jpg HTTP/1.1
Host: img1.goodfon.ru
Accept: */*
* Empty reply from server
* Connection #0 to host img1 .goodfon.ru left intact
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question