After having spent a good few hours with this, I still can't get this to work. I'm using XAMPP with PHP 8.1.6. This is a Laravel 9 project and I'm trying to use GD library. Also, I'm using Laravel's built-in server (php artisan serve
) and not Apache that comes with XAMPP. After having gone through many, many articles and posts, I have configured and verified the following:
phpinfo
tells me that the server is usingphp.ini
fromc:\xampp\php\php.ini
.extension=gd
line inphp.ini
is uncommented.php_gd.dll
is available inC:\xampp\php\ext
folder.- GD appears to be installed in that I can see the following line in phpinfo output:
- I can also see
gd
listed in the output ofphp -m
command. However, there is no detailed GD section in phpinfo output. - When I call a GD function (through Intervention library), it tells me that:
GD Library extension not available with this PHP installation.
- Restarting
php artisan serve
or VSCode itself doesn't change anything. - Starting/stopping Apache through XAMPP Control Panel also doesn't have any effect (plus I can't see why this should be required since I'm not using Apache to serve my application, but this is mentioned in too many articles, so I gave it a try.)
Please suggest if you can see anything else that I could try.
Edit
The suggested post does not address my problem for two reasons. Firstly most answers there are about Linux (apt-get
and sudo
stuff) whereas I'm on Windows 11. The only relevant suggestion in that post is removing the semicolon from the extension entry in php.ini
, which I have already done.
So far it looks like it really might be a limitation of PHP's built-in web server that it can't load GD (or any other) extension. I'd be thankful if someone could confirm it or provide a reference to whether this is or isn't the case.