Fatal error: Call to undefined function: imagecreate()
P粉459578805
P粉459578805 2023-08-27 18:26:11
0
2
744
<p>I'm trying to put some graphics on a web page, and on a prototype on my computer, it's working fine on localhost. But now I'm uploading the file to the server and I'm having trouble drawing some graphics. On my computer they are drawn, but not on the server. </p> <p>I get this error <code>Fatal error: Call to undefined function ImageCreate() in /home/t1g01/phplot.php line 248</code> </p> <p>Line 248</p> <p><code>$this->img = ImageCreate($this->image_width, $this->image_height);</code> </p> <p>I am using phplot and I uploaded files from phplot as well. Can anyone help me? </p> <p>We apologize for any errors in the English and thank you in advance. </p>
P粉459578805
P粉459578805

reply all(2)
P粉170858678

If you are using a Linux computer, execute this command from the console:

sudo apt-get install php5-gd

Install the php_gd2.dll extension. It will start working after Apache is restarted.

PS: You should first check your current php version

php -v

As for me:

So, my PHP version is 7.3, so, the command for my version is:

sudo apt-get install php7.3-gd
P粉738676186

This means that your installation of php does not have the gd library installed/enabled.

http://www.php.net/manual/en/image. install.php

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template