2

I know this question has been asked before but none of the other answers have given me a correct result. I'm on an AWS Linux.

I then installed Laravel and some other dependencies for my project, and it was all working great. But now I need the GD Library Extension and I can't seem to get it to work.

I installed like this:

sudo yum install php-gd

The output I get from php -i | grep gd is this:

/etc/php.d/20-gd.ini,
gd
gd.jpeg_ignore_warning => 1 => 1

In my php.ini called by doing phpinfo(); in my php artisan tinker in my project directory, I have this:

gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.4.11
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 6b
PNG Support => enabled
libPNG Version => 1.5.13
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1

But when I run the Voyager admin panel which requires this extension (when I try to upload an image) I get this error:

production.ERROR: GD Library extension not available with this PHP installation.

I've restarted Apache and confirmed it by doing sudo systemctl status httpd.service and the status confirms the restart. Yet still nothing. Why does the phpinfo say it's installed while the script does not?

Was I supposed to specify a version of PHP on the sudo yum install command? If so how do I do that properly and delete whatever is installed already but not working?

Summer Developer
  • 2,056
  • 7
  • 31
  • 68
  • 1
    It's possible that you have differnet PHP versions for the CLI and Apache, create a simple web page with `phpinfo()` in your web root and navigate to that. Make a note of which `.ini` files are being loaded – RMcLeod Mar 20 '19 at 14:32
  • @RMcLeod odd, you are right there is a discrepancy here but they both say `Loaded Configuration File => /etc/php.ini` so I'm not sure why they are different depending on where I call `phpinfo()` – Summer Developer Mar 20 '19 at 14:41
  • It's almost like the browser one is cached or not reset/updated properly or something but I already restarted httpd. – Summer Developer Mar 20 '19 at 14:43
  • Have a look at the answer to this question https://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension?rq=1 although it is for mcrypt the same applies – RMcLeod Mar 20 '19 at 14:46
  • @RMcLeod I've seen than answer but they both point to the same ini file? – Summer Developer Mar 20 '19 at 14:47

1 Answers1

2

For some reason rebooting Apache was not enough.

sudo reboot (restarting the VM server itself) solved this for me.

Summer Developer
  • 2,056
  • 7
  • 31
  • 68