How do I install GD on my windows server version of PHP
Check php_gd2.dll
is in your extension directory and uncomment ;extension=php_gd2.dll
of your php.ini
.
Enable GD support in PHP
Following are the steps for any php
extension (on MS-Windows
):
- Give absolute path (not relative) to extensions directory [use forward slashes (
/
) instead of backslashes (\
); I'm not too sure whether it's required to end the path with trailing slash.- e.g.:
extension_dir = c:/php5/ext
- e.g.:
- Make sure
php
is referring yourphp.ini
, nowphp.ini
can be inside yourphp
installation root dir.- If your changes to
php.ini
are reflected onphpinfo()
, it's OK. If not, please refer toINSTALL
file inphp
root dir.
- If your changes to
- Restart
apache
if you're bindingphp
as a module toapache
Enable GD support on PHP 7.2 in a Ubuntu 18.04
This command will install the GD extension only if PHP 7.2 is already installed.
If not, it will also install php7.2-common
since it is a dependency.
On a machine without PHP 7.2:
sudo apt install php7.2-gd
Reading package lists... Done
[...]
The following additional packages will be installed:
php7.2-common
The following NEW packages will be installed:
php7.2-common php7.2-gd
and with PHP 7.2 installed:
sudo apt install php7.2-gd
Reading package lists... Done
[...]
The following NEW packages will be installed:
php7.2-gd
Once installed, the GD config files will be created under /etc/php/7.2/(fpm|cli...)/conf.d
and should be named xx-gd.ini
.
These config files are loaded after your main php.ini
and contain extension specific settings (in your case, GD settings).
GD Library extension not available with this PHP installation Ubuntu Nginx
The GD Graphics Library is for dynamically manipulating images.
For Ubuntu you should install it manually:
- PHP7.4:
sudo apt-get install php7.4-gd
- PHP8.0:
sudo apt-get install php8.0-gd
- PHP8.1:
sudo apt-get install php8.1-gd
That's all, you can verify that GD support loaded:
php -i | grep -i gd
Output should be like this:
GD Support => enabled
GD headers Version => 2.1.1-dev
gd.jpeg_ignore_warning => 0 => 0
and finally restart your apache:
sudo service apache2 restart
Related Topics
Confusion Between Bindvalue() and Bindparam()
How Does Pcntl_Fork Work in PHP
Send a JSON Object from Android to PHP Server with Post Method and Httpurlconnection
PHP Include(): File Size & Performance
Ios7 - Receipts Not Validating at Sandbox - Error 21002 (Java.Lang.Illegalargumentexception)
PHP Switch Case More Than One Value in the Case
Multi-Dimensional Array Post from Form
Simulate File Structure with PHP
How to Get All Checkbox Variables Even If Not Checked from HTML to PHP
Extending Sonata User Bundle and Adding New Fields
Doctrine2 Association Mapping with Conditions
How to Specify Multiple Return Types on PHP 7
HTML Form PHP Post to Self to Validate or Submit to New Page
PHP - Create Simple Animated Gif from Two Jpeg Images
Troubleshooting "The Use Statement with Non-Compound Name ... Has No Effect"