0

I've got stuck with using of GD library. I have installed and enabled at php.ini (extension=gd2) the library but when I try to use it I'm getting the error: Call to undefined function App\Http\Middleware\imagecreatefromjpeg().

They say that it should be used --with-jpeg-dir flag. How do I add this flag to Configure Command like at the screenshot attached?

--with-jpeg-dir

Angry Beaver
  • 415
  • 1
  • 6
  • 18
  • Does this answer your question? [imagecreatefromjpeg and similar functions are not working in PHP](https://stackoverflow.com/questions/13338339/imagecreatefromjpeg-and-similar-functions-are-not-working-in-php) – Raptor Jul 10 '20 at 08:56
  • Below is the answer: This was Laravel project and there's an ability to run the site using 'php artisan serve' command which starts its own(in-built) Apache and this Apache doesn't have GD installed. It needs to set up virtual host for the purpose. – Angry Beaver Jul 11 '20 at 08:04

2 Answers2

0

Check out this thread on a similar topic.

StackOverflow: imagecreatefromjpeg and similar functions are not working in PHP

Azeame
  • 2,322
  • 2
  • 14
  • 30
  • Thanks Azeame! The matter is that this is Laravel project. There's an ability to run the site using 'php artisan serve' command which starts its own(in-built) Apache and this Apache doesn't have GD installed. That's why I got the error. I've set up virtual host for the purpose and now it works like a charm! – Angry Beaver Jul 10 '20 at 08:07
0

This was Laravel project and there's an ability to run the site using 'php artisan serve' command which starts its own(in-built) Apache and this Apache doesn't have GD installed. It needs to set up virtual host for the purpose.

Angry Beaver
  • 415
  • 1
  • 6
  • 18