Mateobus Posted August 2, 2006 Share Posted August 2, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/16370-undefined-function/ Share on other sites More sharing options...
akitchin Posted August 2, 2006 Share Posted August 2, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68094 Share on other sites More sharing options...
Mateobus Posted August 2, 2006 Author Share Posted August 2, 2006 Thanks so how do i install the GD? Quote Link to comment https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68109 Share on other sites More sharing options...
akitchin Posted August 2, 2006 Share Posted August 2, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68152 Share on other sites More sharing options...
tomfmason Posted August 2, 2006 Share Posted August 2, 2006 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 Link to comment https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68160 Share on other sites More sharing options...
wildteen88 Posted August 3, 2006 Share Posted August 3, 2006 [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. Quote Link to comment https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68446 Share on other sites More sharing options...
onlyican Posted August 3, 2006 Share Posted August 3, 2006 I would check with the hosting company, as most companies do now use GD libI 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 Quote Link to comment https://forums.phpfreaks.com/topic/16370-undefined-function/#findComment-68449 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.