Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How To Install PHP 7.4 & 5.6 on Pop!_OS

    How To Install PHP 7.4 & 5.6 on Pop!_OS

    By RahulJanuary 27, 20233 Mins Read

    As of today PHP 8 is the latest available version and is recommended to run your production websites. But many of the older websites still required PHP 7.x or PHP 5.6 to run. The application still using PHP 5.6 are advised to immediately upgrade to PHP 7.4 or the latest PHP versions. One way to install PHP on Pop!_OS is to use a Personal Package Archive (PPA).

    Advertisement

    This article provides you with the steps for installing PHP 7.4 or PHP 5.6 on Pop!_OS using a PPA.

  • How to Install PHP 8.x on Pop!_OS
  • Installing PHP on Pop!_OS

    To install PHP on Pop!_OS using a Personal Package Archive (PPA), you can follow these steps:

    1. Install required packages
    2. Open a terminal and install the software-properties-common package, which provides the “add-apt-repository” command that you will use to add the PPA:

      sudo apt update 
      sudo apt install software-properties-common 
      

    3. Add the Ondřej Surý PPA
    4. Add the Ondřej Surý PPA, which provides updated versions of PHP:

      sudo add-apt-repository ppa:ondrej/php
      

      Update the package list again to include the packages in the PPA:

      sudo apt update
      

    5. Installing PHP 7.4 on Pop!_OS
    6. Now, execute the following command to install PHP using the apt package manager:

      sudo apt install php7.4
      

    7. Installing PHP 5.6 on Pop!_OS
    8. PHP 5.6 is no more maintained by the official team. So its strictly recommended to upgrade your application to the latest version. But if you still need to install PHP 5.6, use the following command:

      sudo apt install php5.6
      

    9. Install PHP modules
    10. You can also install the PHP modules that are required for your application. The below-given command will install MySQL, Zip, and Curl PHP modules.

      sudo apt install php7.4-mysql php7.4-zip php7.4-curl 
      

      Make sure to use the correct PHP version with the command.

    11. Verify PHP installation
    12. Verify that PHP was installed correctly by running the following command:

      php -v 
      

      You should see the version of PHP that you installed.

      Output
      PHP 7.4.33 (cli) (built: Nov 8 2022 11:33:35) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies

    Conclusion

    This tutorial helped you to install PHP 7.4 or PHP 5.6 on your Pop!_OS system via PPA. This is a relatively easy way to install PHP, but it is important to note that using a PPA can introduce compatibility issues and security risks. It is generally better to use the Pop!_OS package manager or install PHP from the source.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Implementing a Linux Server Security Audit: Best Practices and Tools

    15 Practical Examples of dd Command in Linux

    Iptables: Common Firewall Rules and Commands

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Python Lambda Functions – A Beginner’s Guide
    • 10 Practical Use Cases for Lambda Functions in Python
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.