skip to Main Content

We wanted to install gd library extension under PHP 8.0.9 on a Linux Debian 10.10 VM Server with apache2 webserver by using the PuTTY console with root access. We tried installing it 2 times but we always end up with the same faulty result. It seems like the "gd.so" file which we assume should be created under "etc/php/8.0/extension/" is missing every time, but that is just our assumption.
Here is how we installed PHP a while ago:

apt install php8.0

We tried installing gd library with the following command after running apt update and apt upgrade

apt-get install php8.0-gd

The installation runs smoothly but the result is unsatisfactory. As you can see on the screenshots below, it looks like it has been installed correctly, but even after rebooting the complete virtual machine the "phpinfo(INFO_ALL);" does not have gd enabled and none of the libraries functions work.

PHP Version

Installed Modules (extensions)

PHP info states it is enabled and running

Potentially missing gd.so file under etc/php/8.0/extension/ ?

The apache2 logfile under var/log/apache2 has no entries regarding this problem.
The /etc/php/8.0/apache2/conf.d/20-gd.ini is mentioned in the phpinfo() header under "Additional .ini files parsed". The content of the file has one line:

extension=gd.so

The same content can be found within the mods-available/gd.ini and the cli/conf.d/@20-gd-ini.

If you need any additional information that can possibly be of any help to sort out what went wrong, please let me know.

2

Answers


  1. Chosen as BEST ANSWER

    We were able to fix the problem ourselves.

    If anyone ever runs into this problem, you just have to search the server for the gd.so file and copy it into your extensions directory in php by using the following commands:

    find / -name gd.so
    

    it should return smth. like

    /usr/lib/php/20200930/gd.so
    

    you can copy said file to your php/8.0/extension directory with

     cp /usr/lib/php/20200930/gd.so /etc/php/8.0/extension/
    

    after that you just need to restart apache2 with

    systemctl restart apache2
    

  2. Did you also try this command?

    sudo apt install php8.0-gd -y
    

    I found it here: https://www.cloudbooklet.com/how-to-install-php-8-on-debian/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search