Paul Cullen
Paul Cullen

Reputation: 11

Cannot get PHP GD library working - Ubuntu 18.04.6 LTS

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

Upvotes: 0

Views: 159

Answers (0)

Related Questions