0

I have an older Ubuntu 18 box that for the life of me i cannot get GD working with my php 8

No matter what i try the gd.so file does not get placed in the correct directory.

I have multiple versions of php installed via the "Virtualmin" server management suite.

So i have run sudo apt-get install php-gd and i get the following output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apt-show-versions libaio1 libapache2-mod-php7.4 libevent-core-2.1-6 libicu64 mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7
  mysql-server-core-5.7 php7.2 php7.2-dev php7.2-mysql php7.2-xml php7.4 php7.4-dev php7.4-mysql php7.4-xml
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  php-gd
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
Need to get 0 B/1,996 B of archives.
After this operation, 12.3 kB of additional disk space will be used.
Selecting previously unselected package php-gd.
(Reading database ... 231612 files and directories currently installed.)
Preparing to unpack .../php-gd_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php-gd (1:7.2+60ubuntu1) ...
Setting up php-gd (1:7.2+60ubuntu1) ...

It looks like its installing GD for 7.2.

There is no package available specifically for php 8 eg php8.0-gd

I have run sudo add-apt-repository ppa:ondrej/apache2 to try and find one.

Looking in "/usr/lib/php" i can find my extensions directory as shown in phpinfo() however there is no gd.so in the php 8 directory.

My theory is its installing the 7.2 version, how can i change that? Can i download the php8.0 gd.so somewhere and manually place it in the extensions directory?

I have of course tried restarting php-fpm and apache, but i can see the files are not in the correct locations so theres no way it can work.

Thanks

Paul

5
  • It's probably named differently. Try apt-cache search gd | grep php to find the proper name for it Commented Sep 13, 2023 at 18:14
  • Here is the output: php-gd - GD module for PHP [default] php7.2-gd - GD module for PHP php-horde-image - Horde Image API php-image-text - Image_Text - Advanced text maipulations in images php-numbers-words - PEAR module providing methods for spelling numerals in words Commented Sep 13, 2023 at 18:40
  • Also try adding ppa:ondrej/php as a repository. apache2 may not have the PHP libraries Commented Sep 13, 2023 at 18:56
  • @aynber that PPA no longer has any packages for 18.04, as it's out of support Commented Sep 13, 2023 at 19:02
  • @ADyson Ah, good to know. Google has failed me today! Commented Sep 13, 2023 at 19:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.