Jump to content


Photo

Undefined Function ?


  • Please log in to reply
6 replies to this topic

#1 Mateobus

Mateobus
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 02 August 2006 - 08:16 PM

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.

#2 akitchin

akitchin
  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 02 August 2006 - 08:34 PM

from the manual:

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.


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

#3 Mateobus

Mateobus
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 02 August 2006 - 09:16 PM

Thanks so how do i install the GD?

#4 akitchin

akitchin
  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 02 August 2006 - 10:05 PM

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.

#5 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 02 August 2006 - 10:17 PM

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
extension=php_gd2.dll
. I am not a 100% sure but I thought that would refer to gd.

Good Luck,
TOm

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#6 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 August 2006 - 10:50 AM

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

extension=php_gd2.dll
. I am not a 100% sure but I thought that would refer to gd.

Good Luck,
TOm

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.

#7 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 03 August 2006 - 10:53 AM

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
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users