Jump to content

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.
Link to comment
https://forums.phpfreaks.com/topic/16370-undefined-function/
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.
Link to comment
https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68094
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.
Link to comment
https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68152
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
Link to comment
https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68160
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.
Link to comment
https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68446
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.