Vardan Danielyan
Vardan Danielyan

Reputation: 21

GD Library extension is not available with this PHP installation

Please help, I have CentOS7 on my server as well as Laravel Project with php 7.3. On CentOS I have httpd and mariadb installed.

When uploading the avatar, I receive the following error:

Intervention \ Image \ Exception \ NotSupportedException

GD Library extension not available with this PHP installation.

Upvotes: 2

Views: 5638

Answers (4)

Nnadi .C Charles
Nnadi .C Charles

Reputation: 1

To install the GD Library extension on Windows 11 for use in your Laravel project, you can follow these steps:

  1. Open your PHP configuration file (php.ini). You can find this file in your PHP installation directory. If you're using XAMPP, the file can be found in the xampp/php directory.

  2. Locate the line that says ;extension=gd (without the semicolon). Remove the semicolon to uncomment the line, so it looks like extension=gd.

  3. Save and close the php.ini file.

  4. Restart your web server (e.g., Apache) for the changes to take effect.

After following these steps, you should be able to use the GD Library extension in your Laravel project. If you encounter any issues, be sure to check your web server's error log for more information.

Upvotes: 0

Zendem
Zendem

Reputation: 528

I was getting this issue too. Ubuntu; apt-get install libpng-dev Centos; yum install libpng-devel This has been resolved with downloads.

Upvotes: 0

Remi Collet
Remi Collet

Reputation: 7041

First check which is the provider for php

# rpm -qf /usr/bin/php
php-cli-7.3.3-1.el7.remi

So you need to install the extension, from the same provider, from the same repository, in the same rpm namespace

# yum-config-manager --enable remi-php73
# yum install php-gd

Reading your answer, it seems you are confused by php73-* packages, read Difference between php-* and php##-php-* packages ? in the FAQ

I also recommend you carefully read the Wizard instructions.

You never have to edit ini file to enable an extension, each RPM package provides its own configuration file (e.g. /etc/php.d/20-gd.ini).

Upvotes: 0

Vardan Danielyan
Vardan Danielyan

Reputation: 21

i found a solution. First of all

yum --enablerepo=remi install php73-php-gd

Then after

systemctl restart httpd

i went to my php.ini file and added extention path to

extension=/opt/remi/php73/root/usr/lib64/php/modules/gd.so

and after did

systemctl restart httpd

Now everything works fine.

Upvotes: -2

Related Questions