I am getting following error while generating qrcode in php.
Error:
Fatal error: Uncaught Error: Call to undefined function ImageCreate()
Fatal error: Uncaught Error: Call to undefined function ImageCreate() in E:\files\includes\phpqrcode\qrimage.php:74
Stack trace:
#0 E:\files\includes\phpqrcode\qrimage.php(32): QRimage::image(Array, 5, 4)
#1 E:\files\includes\phpqrcode\qrencode.php(494): QRimage::png(Array, false, 5, 4, false)
#2 E:\files\includes\phpqrcode\qrencode.php(286): QRencode->encodePNG('eyJhbGciOiJSUzI...', false, false)
#3 E:\files\generate_qr.php(12): QRcode::png('eyJhbGciOiJSUzI...', false, 0, 5, 4, false)
#4 {main}
thrown in E:\files\includes\phpqrcode\qrimage.php on line 74
.
.
.
I have enebled gd extension by following this question: Fatal error: Call to undefined function: imagecreate()
Following is my php.ini:
extension=php_gd2.dll
But still getting error.
I tried changing php version, tried different php files but still getting error.
I tried running the application as administrator also.
I am using Windows 11
.
I tried following code to check if gd extension is enebled.
<?php
if (extension_loaded('gd')) {
echo "GD library is enabled.";
} else {
echo "GD library is not enabled.";
}
?>
It returns: GD library is not enabled.
.
Why is gd extension is not being enebled?
.
.
In phpinfo();
it shows this:
GD imaging: Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger