We’ll use the repository by Ondřej Surý that we previously used.įirst, make sure you have the following package installed so you can add repositories: apt-get install software-properties-common To install PHP 8.0 you’ll need to use a third-party repository. These are the instructions on how to install it on Ubuntu 22.04 or Ubuntu 20.04 (or any other Ubuntu) Update Ubuntuįirst, update your Ubuntu server: apt-get update & apt-get upgrade Add the PHP repository PHP 8.1 is the newest PHP version released on. To check all the PHP modules available in Ubuntu, run: apt-cache search -names-only ^php How to install PHP 8.1 on Ubuntu 22.04 or 20.04 You may need more or less, so check the requirements of the software you’re planning to use: apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php These are the most common PHP 7.4 modules often used by php applications. PHP 7.4 is installed on your Ubuntu 20.04 server. You should get a response similar to this: PHP 7.4.3 (cli) (built: 23:16:22) ( NTS )Īnd that’s it. To verify if PHP is installed, run the following command: php -v This command will install PHP 7.4, as well as some other dependencies. Next, to install PHP 7.4 on Ubuntu 20.04, just run the following command: apt-get install php Update UbuntuĪgain, before doing anything, you should update your server: apt-get update & apt-get upgrade Install PHP 7.4 We don’t recommend using PHP 7.4, so you should skip to some of the other installation methods below. The instructions are also similar for Ubuntu 22.04, but Ubuntu 22.04 will use whatever the default PHP version it’s using. So the instructions are pretty similar to other variations. PHP 7.4 is included by default in Ubuntu 20.04’s repositories.
0 Comments
Leave a Reply. |