search

Home  >  Q&A  >  body text

Fatal error: Call to undefined function: imagecreate()

<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粉459578805P粉459578805488 days ago746

reply all(2)I'll reply

  • P粉170858678

    P粉1708586782023-08-28 12:47:38

    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

    reply
    0
  • P粉738676186

    P粉7386761862023-08-28 10:47:38

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

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

    reply
    0
  • Cancelreply