I have installed php from ondrej. I followed many answers about removing it. However, the apache does not able load php but everytime I try to use php -v from the terminal it returns :

PHP 7.1.4 (cli) (built: May 9 2017 21:55:10) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

  • Have you removed the ondrej PPA from your apt lists? Jul 1, 2017 at 4:04
  • Yes using purge
    – SaidbakR
    Jul 1, 2017 at 4:32
  • 1
    Purge only removes the packages and configs, did you actually remove the repos from /etc/apt/? After you remove them there, then you need to update apt-get install update and then reinstall apt-get install php libapache2-mod-php php-mcrypt php-mysql Jul 1, 2017 at 4:34

1 Answer 1


I also had the same issue. You have to sudo apt-get purge php*.

  • Can you do this for a specific version of php? I used sudo apt-het purge php7.3 and it said it uninstalled but when I ran php -v it is still showing php7.3 instead of php7.4 Jan 9, 2020 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.