PHP8 gd Activate after installation

PHP8 GD activate after installation. GD doesn’t get activated by default. Not even a reboot after installation will activate it. So how do we do it?

In this example I have used Debian 11 to verify. But most newer Debian based distros should be the same. And PHP8.0 is used. Any PHP8 GD should also be done like this.

Disclaimer! If you are not local at the actual computer you are trying to activate gd, just change the localhost to appropriate address. And if you are using a PHP version different from 8.0, just change to the correct version in the commands you are issuing.

Open Terminal and then open the php config file.

sudo nano /etc/php/8.0/apache2/php.ini

Within the php.ini file, search for the following line:

;extension=gd

Remove the semicolon so you have

extension=gd

Save the changes by pressing Ctrl + O, then exit the editor by pressing Ctrl + X.

Restart Apache for the changes to take effect by executing the following command:

sudo systemctl restart apache2

To verify that the gd extension is now active, create a PHP file with the following content:

<?php
  phpinfo();
?>

Save the file as phpinfo.php.

Move the PHP file to the web server’s document root folder:

sudo mv phpinfo.php /var/www/html/

Open a web browser and access the following URL:

http://localhost/phpinfo.php

This will display the PHP information page. Search for “gd” on the page, and if you find relevant information about the GD extension, it means the php8.0-gd extension is now active.

By following these steps, you should be able to activate the php8.0-gd extension in Debian 11.

PHP8 GD Manual

My PHP Archive

About Author

Related Posts

Debian 12: linux-image-6.1.0-10amd64

Troubleshooting dependency issues in Debian 12: Resolving linux-image-6.1.0-10amd64 package dependency problems. If you installed the Debian 12 from the live image the issue is the raspi-firmware. Even…

OpenMediaVault default password

OpenMediaVault default password

OpenMediaVault default password is printed in the documentation. I did not see it the first time I installed it either. So I had to do some detective…

Debian change dns

Debian change DNS settings to a new DNS

Debian change DNS settings for speed improvement or privacy. It is really easy to do. So let us see how it’s done and get to it. The…

Upgrade debian 9 to debian 10

Upgrade Debian 9 to Debian 10

Upgrade Debian 9 to Debian 10 is very similar to upgrading previous versions. The only you need to do is change the sources to Buster instead of…

Debian 10 Static IP

Debian 10 Static IP

Debian 10 static IP works just like the previous version. They changed the naming of the network interfaces in Debian 9. However if you have upgraded from…

Install .net core on Debian 10

Install dotnet core on Debian 10

Install dotnet core on Debian 10 is essential to run dotnet core application on Debian. This time Microsoft has done it easy to install dotnet core 3…

Leave a Reply