Меню Закрыть

Call to undefined function imagecreate

Содержание

I’m trying to put some graphics on a web page and at my prototype at the computer it’s all working fine at the localhost. But now I uploaded the files to a server and I’m having a problem to plot some graphics. In my computer they are plotted, but on the server they are not.

I’m getting this error Fatal error: Call to undefined function ImageCreate() in /home/t1g01/phplot.php on line 248

$this->img = ImageCreate($this->image_width, $this->image_height);

I’m using phplot, and I uploaded the files form phplot too. Can anyone help me ?

Sorry for any mistake in English and thank you in advance.

Comments

Copy link Quote reply

501st-alpha1 commented Jan 19, 2015

I am trying to get a server set up for testing the client I am developing, but am running into some problems.

I have Apache’s DocumentRoot set to point to the sample folder in this repo. When I visit the index page, no QR code is displayed, and I see this in the logs every few seconds:

Are there some dependencies I’m missing or something?

This comment has been minimized.

Copy link Quote reply

jurgenhaas commented Jan 19, 2015

Sorry for that, it appears that this QR code library requires the GD extension for your PHP. On a Debian system you could install that with apt-get install php5-gd and then restart Apache. I’ll have a look on if and how we can make that more reliable and/or to provide alternatives.

This comment has been minimized.

Copy link Quote reply

501st-alpha1 commented Jan 22, 2015

That did the trick, thanks!

  • © 2020 GitHub, Inc.
  • Terms
  • Privacy
  • Security
  • Status
  • Help
Читайте также:  Сон через командную строку

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Your PHP installation does not have the GD Library installed or it is not enabled.

The GD Library is bundled with PHP, but needs to be enabled during installation.

You will need Administrator rights to your server to enable the GD Library. If you do not have Administrator access, please contact your support and ask them to enable it for you.

It is recommended that your GD Library version is later than gd-2.0.28. Versions older than gd-2.0.28 may not have GIF support. Versions lower than 2 do not support true color images.

=======================================
Linux / Unix – Administrators (root access)
=======================================
Your PHP would need to be compiled with the GD Library.

"To enable GD-support configure PHP –with-gd[=DIR], where DIR is the GD base install directory. To use the recommended bundled version of the GD library (which was first bundled in PHP 4.3.0), use the configure option –with-gd. GD library requires libpng and libjpeg to compile."

Please refer to the PHP manual / installation instructions for more info.

It is also possible to get pre-compiled binaries of PHP with the GD Library built in.

On some systems, you will be able to install by simply typing this in:

yum install gd php-gd

If you are hosting on Windows and have Administrator access, you can easily enable the GD Library that is distributed with PHP.

Читайте также:  Технопоинт флешка 32 гб

Please see PHP the documentation to learn how to enable extensions in Windows.

Рекомендуем к прочтению

Добавить комментарий

Ваш адрес email не будет опубликован.