Jump to content

Archived

This topic is now archived and is closed to further replies.

Mateobus

Undefined Function ?

Recommended Posts

I am using a script that creates image thumbnails on the fly.  The script that i found relies on the function imagecreatetruecolor().  When i run this script i get the following error: Fatal error: Call to undefined function: imagecreatetruecolor().  I take it that my version of php does not have this function.  Is there a way that I can still use this script.  Is there a way i could just copy the necesary functions and include them in a separate file...  Any help is much appreciated.

Share this post


Link to post
Share on other sites
from the manual:

[quote]Depending on your PHP and GD versions this function is defined or not. With PHP 4.0.6 through 4.1.x this function always exists if the GD module is loaded, but calling it without GD2 being installed PHP will issue a fatal error and exit. With PHP 4.2.x this behaviour is different in issuing a warning instead of an error. Other versions only define this function, if the correct GD version is installed.[/quote]

it pays to read it once in a while, you know.  my suspicion is that you don't have the GD library installed.

Share this post


Link to post
Share on other sites
as far as i know, you need to have PHP recompiled with the --gd-enabled option in the command line.  if you're on a shared hosting plan, it's unlikely that they are willing to do this.  if it's your own server, simply reinstall PHP with the GD library enabled.

someone feel free to correct me on the recompilation requirement.

Share this post


Link to post
Share on other sites
Is there a gd extension that you can use in the php.ini or no? I just looked in the php.ini on my local windows machine and saw [code]extension=php_gd2.dll[/code]. I am not a 100% sure but I thought that would refer to gd.

Good Luck,
TOm

Share this post


Link to post
Share on other sites
[quote author=tomfmason link=topic=102770.msg408460#msg408460 date=1154557077]
Is there a gd extension that you can use in the php.ini or no? I just looked in the php.ini on my local windows machine and saw [code]extension=php_gd2.dll[/code]. I am not a 100% sure but I thought that would refer to gd.

Good Luck,
TOm
[/quote]That would work if Mateobus is hosted on a Windows server but Mateobus will need to have root access to get to the php.ini file. However if its unix based server then as akitchin mentioned above PHP will need to be recompile with the --gd-enabled option.

Share this post


Link to post
Share on other sites
I would check with the hosting company, as most companies do now use GD lib

I remember a function not working for me, I spoke to tech support on the hosting, and cos I was on a new server, the lib I needed was not compiled correctly. So they fixed it

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.