imagecreatefromjpeg and similar functions are not working in PHP

Home / Answer

imagecreatefromjpeg and similar functions are not working in PHP

Author | Asked on 2024-06-26 | • PHP Mysqli

Whenever I run functions like imagecreatefromjpeg, I get this:

Fatal error: Uncaught Error: Call to undefined function imagecreatefromjpeg() in 

I’m working on a new install of PHP; my last installation never had this problem. I don’t get what’s going on. 

authorTapGen replied on 2024-06-30

If you have installed XAMPP with PHP 8 support then there are chances GD extension is not enabled by default. Please edit php.ini file add the following line somewhere and restart your XAMPP and Apache server.

Make sure your php.ini has this line enabled for PHP 8

extension=php_gd.dll

For PHP lower than 8

extension=php_gd2.dll

authorAkif Hossain replied on 2024-07-05

  1. Go to xampp control panel
  2. Click Config Button
  3. From Dropdown open file PHP (php.ini)
  4. Fine ;extension=gd
  5. Remove ; from start
  6. Restart XAMPP server

Please login your account for replying

Do you want to get the latest update?