Facebook Twitter Instagram
    • Privacy Policy
    Facebook Twitter Instagram Pinterest Vimeo
    Hibernate CoderHibernate Coder
    • Home
    • PHP
    • Python
    • Others
    Subscribe
    Hibernate CoderHibernate Coder
    Home»PHP»How to Install or Upgrade PHP 8.0 for Laravel 9 on Ubuntu 20.04
    PHP

    How to Install or Upgrade PHP 8.0 for Laravel 9 on Ubuntu 20.04

    Wenhao KhoBy Wenhao KhoMarch 1, 2022Updated:March 1, 2022No Comments1 Min Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Prerequisites

    Basic knowledge of using SSH Terminal on Linux.

    Getting Started

    Make sure your Ubuntu server is having the latest packages by running the following command.

    sudo apt update
    sudo apt upgrade
    

    Add PPA for PHP 8.0

    Add the ondrej/php which has PHP 8.0 package and other required PHP extensions.

    sudo apt install software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt update
    

    Once you have added the PPA you can install PHP 8.0

    Install PHP 8.0 & PHP Extensions

    Installing PHP are simple with the following syntax.

    sudo apt install php-8.0
    

    Now, install some commonly used php-extensions with the following command.

    sudo apt install php8.0-common php8.0-mysql php8.0-xml php8.0-xmlrpc php8.0-curl php8.0-gd php8.0-imagick php8.0-cli php8.0-dev php8.0-imap php8.0-mbstring php8.0-opcache php8.0-soap php8.0-zip php8.0-redis php8.0-intl -y
    

    Switch php versions

    sudo update-alternatives --config php
    

    should work for all ubuntu versions after 16.04 (18.04 and 20.04)

    Choose the appropriate version

    Conclusion

    Now you have learned how to install PHP 8.0 on your Ubuntu 20.04 and also how to upgrade to latest version.

    Thanks for your time. If you face any problem or any feedback, please leave a comment below.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Next Article Secure your data with Laravel 8: Stop Undefined Auth Attempts and Protect Your Passwords!
    Wenhao Kho
    • Website

    Related Posts

    PHP

    Secure your data with Laravel 8: Stop Undefined Auth Attempts and Protect Your Passwords!

    December 29, 2022
    Add A Comment

    Leave A Reply Cancel Reply

    Facebook Twitter Instagram Pinterest
    • Privacy Policy
    © 2023 ThemeSphere. Designed by ThemeSphere.

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

    Go to mobile version