"Fatal error: Uncaught Error: Call to undefined function ImageCreate() in C:\xampp\htdocs\practice\phpqrcode\qrimage.php:74 Stack trace: #0 C:\xampp\htdocs\practice\phpqrcode\qrimage.php(32): QRimage::image(Array, 3, 4) #1 C:\xampp\htdocs\practice\phpqrcode\qrencode.php(494): QRimage::png(Array, 'qrcodes/image.p...', 3, 4, false) #2 C:\xampp\htdocs\practice\phpqrcode\qrencode.php(286): QRencode->encodePNG('codedamn.com', 'qrcodes/image.p...', false) #3 C:\xampp\htdocs\practice\another.php(11): QRcode::png('codedamn.com', 'qrcodes/image.p...') #4 {main} thrown in C:\xampp\htdocs\practice\phpqrcode\qrimage.php on line 74" here is the error

am trying to print out the image of the qr code but it doesn't work at all

1

There are 1 best solutions below

0
Ken Lee On

You need to enable GD library in order to use ImageCreate() in PHP

For XAMPP, please follow the steps below (but the exact steps for different XAMPP versions may be slightly different, but should be very similar)

  • Open xampp control panel.
  • Start apache and mysql.
  • Click on config option of apache.
  • Click on php. ini and open it.
  • Press Ctrl + F and search "extension=" or "extension=fileinfo".
  • On the next line to "extension=fileinfo", add "extension=gd".
  • Save the file.
  • Stop apache and restart it.