
August 26th, 2005
09:41 PM
Problem - Img functions not working
Alright, so I have this site. A little while ago, we updated the PHP version on the server to 4.4.0.
Somehow, now, I can't create images in PHP anymore. I used to have one before the update which is no longer working. I'm thinking this is something to do with some default configuration value that has changed from version to version? You can view the phpinfo() function here. Are there any values I should pay specific attention to? A page like this won't work:
<?php
header("Content-type: image/png");
$im = @imagecreate(100, 50)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
Anyway, I'm kind of a newbie at these things, so I'd appreciate your help.
___________________
Lockout7 - the Webcomic

August 26th, 2005
09:53 PM
Jag är Gandalf den grå och den vite, men vem är du?
Status: Offline!
To me, it looks like you don't have the GD library installed. :P
___________________
Neversidian, your staff is broken.
Last edited by Simon, August 26th, 2005 09:56 PM (Edited 1 times)

August 26th, 2005
09:56 PM
GD Library? What is that? o_O
___________________
Lockout7 - the Webcomic

August 26th, 2005
11:25 PM
Web Developer & Geek
Status: Offline!
make a file called anything.php and put this in:
Somewhere in there should be a bit about the GD library which handles graphics stuff. If you don't have it (but I think it comes by default) then you won't be able to use those functions (again I think).
___________________


August 27th, 2005
12:19 AM
Neversidian
Status: Offline!
if you are on a hosted server, talk to your host and ask if they can enable the GD library on your PHP version. If you arent on a hosted server, google gd2 installation and you shpuld get the info you need.
just a lil extra info. the GD library is the set of functions that actually does the image editing. PHP has just been ported to work along with it to allow you to edit images straight from the php engine.
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

August 27th, 2005
01:05 AM
Alright, thanks for the help, guys.
By the way, Dachande663, I had done that. Read my post again. =P
___________________
Lockout7 - the Webcomic

August 27th, 2005
09:44 AM
Neversidian
Status: Offline!
well according to your phpinfo your gd lib is installed.
see what happens when you do
<?php
print_r(gd_info());
?>
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

August 27th, 2005
09:55 AM
Jag är Gandalf den grå och den vite, men vem är du?
Status: Offline!
Originally posted by BigToach:
well according to your phpinfo your gd lib is installed.
see what happens when you do
<?php
print_r(gd_info());
?>
I think he just got it installed because I can swear it wasn't there when I looked before. :)
___________________
Neversidian, your staff is broken.

August 27th, 2005
11:39 AM
Neversidian
Status: Offline!
yeah i had the same feeling as well...
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

August 27th, 2005
07:30 PM
Yep, thanks a lot for your help. It's now working. =)
___________________
Lockout7 - the Webcomic