How do I completely uninstall old php?

Discussion in 'ISPConfig 3 Priority Support' started by concept21, Sep 23, 2021.

  1. concept21

    concept21 Active Member HowtoForge Supporter

    Hello,
    I have done a new ISPConfig 3.2.5 auto installation on an Ubuntu 20.04. It was a big success!

    However, I see many old php versions having also been installed. How do I uninstall them completely, including those php-fpm instances?
    I want to remove
    php 5.6
    php 7.0
    php 7.1
    :rolleyes:
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Ensure no sites are using those versions, then delete the corresponding additional php versions in ISPConfig, then remove system packages, eg. "dpkg --list | grep php5.6 | awk '{print $2}' | xargs apt remove -y" should catch 5.6 .. and you can "purge" instead of "remove" if you wish.
     
    Th0m likes this.
  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Code:
    apt remove php5.6 php7.0 php7.1
    apt autoclean
    will probably do the trick.
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Same as @Th0m above except I'll normally add * at the end of php version that I wish to remove to ensure all its plugins are being removed as well.
     
  5. concept21

    concept21 Active Member HowtoForge Supporter

    I try
    apt -s purge php5.6*
    but it will include phpmyadmin as well. :p
     
  6. concept21

    concept21 Active Member HowtoForge Supporter

    the problem is how to skip php5.6-mysql from being purged?
     

Share This Page