GD library problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Rickertsen2
Forum Newbie
Posts: 2
Joined: Sat Apr 10, 2004 10:25 am

GD library problems

Post by Rickertsen2 »

Ok so i have spent my weekend writign an image gallery script. All was going well until i started writing my thumbnailing and resizing functions. Each time i try to call any GD library function, i get an error complaining the function doesn't exist. gd_info() won't even return anything. It doesn't exist either. I figured the problem must be that my webhost doesn't have GD installed, so i emailed them. They replied, telling me that it is installed and working. What do i do at this point? BTW they are running PHP 4.3.3 Any help would be greatly appreciated.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

if it says something to the effect of "undefined function ....." then indeed GD is not installed create a new page and try this, it will reveal all loaded "extensions".

Code: Select all

<?php
print_r(get_loaded_extensions());
?>
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

What does the following show?

Code: Select all

<?php
if(function_exists('imagecreate')){
    echo 'Got GD';
} else {
    echo 'Not got GD';
}
?>
Rickertsen2
Forum Newbie
Posts: 2
Joined: Sat Apr 10, 2004 10:25 am

Post by Rickertsen2 »

malcolmboston wrote:if it says something to the effect of "undefined function ....." then indeed GD is not installed create a new page and try this, it will reveal all loaded "extensions".

Code: Select all

<?php
print_r(get_loaded_extensions());
?>
Array ( [0] => xml [1] => tokenizer [2] => standard [3] => sockets [4] => session [5] => posix [6] => pcre [7] => overload [8] => openssl [9] => mysql [10] => ftp [11] => curl [12] => ctype [13] => calendar [14] => bcmath [15] => zlib [16] => apache [17] => Zend Optimizer )

markl999 wrote:What does the following show?

Code: Select all

<?php
if(function_exists('imagecreate')){
    echo 'Got GD';
} else {
    echo 'Not got GD';
}
?>
Not got GD


I guess this means its time to argue with my webhost now?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Yep.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

mine and marks script do pretty much the same thing,

you definitely do not have GD
Post Reply