14

I get the error from my cakephp 2.x project:

The PHP GD extension is required, but is not installed.

I use php7.3 with apache on debian

I search and find

apt-get install php7.3-gd

I tried this but i only get following error:

E: Unable to locate package php7.3-gd
E: Couldn't find any package by glob 'php7.3-gd'
E: Couldn't find any package by regex 'php7.3-gd'

I searched again, but didnt find a soulution for this problem only for ubunto and nothing else worked. I hope someone could help me with this problem.

andre.hey
  • 199
  • 1
  • 2
  • 13

2 Answers2

25

It looks like you do not have the appropriate repo added. Try :

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.3-gd
Will
  • 899
  • 8
  • 15
  • 4
    if i do this following message comes: /bin/sh: 1: add-apt-repository: not found The command '/bin/sh -c add-apt-repository ppa:ondrej/php' returned a non-zero code: 127 – andre.hey Aug 14 '19 at 10:21
  • 2
    add-apt-repository is probably not installed, try sudo apt-get install software-properties-common – Will Feb 18 '20 at 11:46
  • 2
    wow, now even this is broken :/ `Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 688, in addkey_func func(**kwargs) ` – Sliq Oct 18 '20 at 21:12
0

@Will's answer did not work for me, I then replace the first command from sudo add-apt-repository ppa:ondrej/php to sudo apt-add-repository ppa:ondrej/php and it works for me. So finally I run:

sudo apt-add-repository ppa:ondrej/php    
sudo apt-get update
sudo apt-get install -y php7.3-gd
Siddiqui Noor
  • 5,575
  • 5
  • 25
  • 41