You are not logged in.
Hello guys,
I have a problem with php-gd. I installed it, uncommented the "extension=gd.so" line in the php.ini file and it appeared in the php infos (with php_info()). At that time I was still happy
But to my stupefaction imagecreatejpeg and getimagesize seem to be not working : they return bool(false) all the time.
I don't understand the problem since gd_info() is working, gd must be loaded properly.
-> I have libpng, freetype2 and libjpeg-turbo, the right set of permission over the file gd.so (755 root:root) and the extension_dir (from php.ini) is correct.
I don't know what to look next...
Anyone knows better ?
Last edited by Sulice (2014-11-26 11:43:26)
Offline
What happens if you do
<?php
error_reporting(-1);
ini_set('display_errors', 'On');
getimagesize($file);
Offline
Okay, here is the code :
<?php
error_reporting(-1);
ini_set('display_errors', 'On');
$arr_img = getimagesize("http://i.imgur.com/OupnMlU.jpg");
var_dump($arr_img);
$im = imagecreatefromjpeg("http://i.imgur.com/OupnMlU.jpg");
var_dump($im);
imagedestroy($im);
?>
And here is the output :
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /srv/http/test.php on line 4
Warning: getimagesize(http://i.imgur.com/OupnMlU.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /srv/http/test.php on line 4
bool(false)
Warning: imagecreatefromjpeg(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /srv/http/test.php on line 6Warning: imagecreatefromjpeg(http://i.imgur.com/OupnMlU.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /srv/http/test.php on line 6
bool(false)
Warning: imagedestroy() expects parameter 1 to be resource, boolean given in /srv/http/test.php on line 8
Offline
b
Last edited by ackt1c (2022-11-05 13:36:46)
Offline
I can visit the link. By fail do you mean that gd cannot access it ? (I checked an the fopen option for urls was on in my php.ini)
I need to work with urls and not images on my computer.
I'll try imagick this evening. (In 9h for me)
Offline
For
Last edited by ackt1c (2022-11-05 13:36:15)
Offline
I quickly installed imagick, restarted apache and gd started working.
Dunno what happened... Is a reboot not like a restart for apache ?
I shall give a try to imagick but anyhow, the problem is solved.
Thanks !
Offline