Php error extension=gd is not found

On the localhost the library is working fine, when the function is called on production,php throws a fatal errer.

i checked the phpinfo() its there and it is enabled.

I tired to see if there is anything that i can add on the php.ini but i couldn't find any. The error is thrown when i call

gd_info();

Is there anything that i can add on the php.ini file that can solve this problem, or is there another library for gd?

The error am getting is the following

Fatal error: Call to undefined function gd_info(

asked Jun 5, 2011 at 16:33

4

I had exactly the same problem

although I had installed it using apt-get install php7.0-gd that function was undefined, so I inspected php.ini file in /etc/php/7.0/apache2/php.ini

turned out that the line for gd extension was commented!

so I removed semicolon before the line and it was working!

so crazy wasted an half an hour of mine :D

answered Nov 18, 2016 at 17:51

Php error extension=gd is not found

DeveloperiumDeveloperium

7,0455 gold badges33 silver badges54 bronze badges

It may be a little bit late, but I hope it helps anyone.

I had the same problem when I tried to run GD over apache. The problem was in php.ini path for apache. By default it is not using php.ini from php directory. You need to define PHPIniDir in httpd file or place copy of php.ini to apache folder.

To check if it is your case you can compare output of php --ini from php folder and output of phpinfo() over apache. If it is showing different php.ini destinations you need to fix it.

answered Jun 9 at 19:42

EgorEgor

1,1826 silver badges21 bronze badges

Installing and upgrading help

PHP-GD installed, but getting "The GD extension is required" error

  • ◄ Forced plugin upgrading
  • Database error after installation of existing system using Softaculous ►

I have the php-gd extension installed and up to date. However, I am getting the following error when trying to upgrade:

Php error extension=gd is not found

The error wasn't there at first, but after I installed other necessary extensions (simplexml, dom, and xmlreader), the GD extension issue suddenly showed up.

I'm not sure what to do from here. Any help would be appreciated.

If you've installed the PHP-GD extension have you restarted the web server service to pick up the new configuration? On a Linux server this service might be called httpd, apache2 or php-fpm. On my CentOS server the command needed is systemctl restart php-fpm.

Sorry, I should have mentioned that. Yes, I restarted the web server service.

I also tried removing and reinstalling GD, and I restart the service each time I make a change before checking the Moodle upgrade again.

Create a file in the root of your Moodle installation called test.php. Put the single line in it...


 

Execute test.php through your browser (https://your.domain.com/test.php or whatever). The resulting page should show the PHP setup. Search for references to GD on that page. Can you find any? What do they say?

I was able to find the issue.

After installing GD and running which php extensions were installed (php -m), I received a warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'gd' (tried: /opt/remi/php74/root/usr/lib64/php/modules/gd (/opt/remi/php74/root/usr/lib64/php/modules/gd: cannot open shared object file: No such file or directory), /opt/remi/php74/root/usr/lib64/php/modules/gd.so (/lib64/libraqm.so.0: undefined symbol: hb_ft_font_set_load_flags)) in Unknown on line 0

To resolve this, I had to install a dependency for libraqm called harfbuzz.

Then gd was successfully enabled and recognized. Thanks for the help!

  • ◄ Forced plugin upgrading
  • Database error after installation of existing system using Softaculous ►

How do I enable GD?

Installing PHP GD in Windows.
Step 1: Install XAMPP in your windows system..
Step 2: Verify if GD is already installed or not. ... .
Step 3: Locate and open php. ... .
Step 4: Find ;extension=gd..
Step 5: Remove semicolon from ;extension=gd and save the file..
Step 6: Go to php folder. ... .
Step 7: Look for php_gd. ... .
Step 8: Copy php_gd..

How do I enable or uncomment the GD library on my PHP INI file?

Windows Server users.
Open your PHP. ini file in Notepad, or your preferred WYSIWYG editor. This file is normally located in the C:\Windows\ directory..
Locate the following line. ;extension=php_gd2.dll..
Remove the preceding semicolon (;) to enable the option..
Save your file..
Restart the web server..

Which function should be run to watch that GD Support is enabled or not?

To know this we can use phpinfo function and check GD support is available or not.