logo

  • Hỏi Đáp
  • Kiến Thức
  • Sức Khỏe
  • Tử Vi
  • Công Nghệ
No Result
View All Result
logo
No Result
View All Result
Trang chủ install php 7

INSTALL PHP 7

by Admin _ April 27, 2022

PHP 7.4 is the latest stable release available. Say thanks to Ondřej Surý for maintaining PPA of most the popular PHP versions on launchpad. If you want to install a specific or multiple version of PHP, then this article can be helpful for you. This article will help you to install PHP 7.4, 7.3, 7.2 and 5.6 on Ubuntu 20.04 (Focal Fossa) via PPA.

Bạn đang xem: Install php 7

You can install multiple PHP versions on Ubuntu system and then switch PHP version as per your requirements. You can also configure Apache to run PHP web applciation’s with different-2 PHP versions.

Step 1 – Add PHP PPA

First of all, you need to configure repository on your system. Run the following command to add ondrej PHP repository to your Ubuntu system.

sudo apt install software-properties-commonsudo add-apt-repository ppa:ondrej/phpThe above command will also update the packages information list. But if you already have repository added, then update the packages information before installing or updating package:

sudo apt updateOnce the update complete, lets begin the PHP installation.

Step 2 – Install Required PHP Version

You can install any required php version on your Ubuntu system. Use one of the following options to install PHP.

Install PHP 7.4

PHP 7.4 is the latest stable version available for installation. To install PHP 7.4 on your Ubuntu system run command:

sudo apt install -y php7.4

Install PHP 7.3

PHP 7.3 is an current active release of PHP. The PHP team is still providing updates on this version. To install PHP 7.3 on Ubuntu, type:

sudo apt install -y php7.3

Install PHP 7.2

For the PHP 7.2, the development is only providing security updates and fixed. Further development on this version is stopped. To install this version run commands:

sudo apt install -y php7.2
Info: This repository also contains PHP 7.1 and PHP 7.0 versions. You can install them by changing the php version number in above commands.

Xem thêm: The Nsa Là Gì - Nghĩa Của Từ Nsa Trong Tiếng Việt


Install PHP 5.6

PHP 5.6 is an outdated version. Its development is stopped and no more security updates available. But if you application still relies on this version use below command to install it.

sudo apt install -y php5.6But it is recommended to upgrade your applications and make them compatible with latest PHP versions.

Step 3 – Check PHP Version

To view the current active PHP version run the following command:

Step 4 – Install PHP Modules

You may also need to install modules based on your application requirements. Use the following command to search available PHP 7 modules in the package repository.

sudo apt-cache search php7*You can install the required PHP modules on your system. Just change the PHP version with the packages names as per your requirements:

sudo apt install php7.4-mysql php7.4-curl php7.4-json php7.4-cgi php7.4-xsl

Step 5 – Switch Between PHP Versions

You can use update-alternatives command to set the default PHP version. Use this tutorial to read more details about switching PHP version for CLI and Apache.

sudo update-alternatives --config phpSelect PHP version number as per your requirement. This will change the PHP CLI version only.

There are 4 choices for the alternative php (providing /usr/bin/php). Selection Path Priority Status------------------------------------------------------------* 0 /usr/bin/php7.4 74 auto mode 1 /usr/bin/php5.6 56 manual mode 2 /usr/bin/php7.2 72 manual mode 3 /usr/bin/php7.3 73 manual mode 4 /usr/bin/php7.4 74 manual modePress to keep the current choice<*>, or type selection number: 4

Conclusion

This tutorial helps you to install PHP 7.4, 7.3, 7.2 or PHP 5.6 on your Ubuntu 20.04 system.

ShareTweet Linkedin Pinterest
Previous Post

Php url encode get

Next Post

Bắt đầu học php từ đâu

CÙNG CHUYÊN MỤC

form register php

Form register php

09/04/2021
fantastic blog (cms) in php with source code

Fantastic blog (cms) in php with source code

28/04/2021
validate form php javascript

Validate form php javascript

28/04/2021
http diendanlequydon com viewtopic php style 6

Http diendanlequydon com viewtopic php style 6

28/04/2021
how to install the lamp stack on centos 7

How to install the lamp stack on centos 7

21/05/2022
login with facebook using php sdk

Login with facebook using php sdk

21/05/2022
upload file trong php

Upload file trong php

21/05/2022
webstorm: the smartest javascript ide, by jetbrains

Webstorm: the smartest javascript ide, by jetbrains

20/05/2022

Newsletter

The most important automotive news and events of the day

We won't spam you. Pinky swear.

Chuyên Mục

  • Hỏi Đáp
  • Kiến Thức
  • Sức Khỏe
  • Tử Vi
  • Công Nghệ

News Post

  • Bệnh thiếu hơi đàn ông ở phụ nữ

About

Chúng tôi tạo ra trang web nhằm mục đích mang lại kiến thức bổ ích cho cộng đồng, các bài viết được sưu tầm từ nhiều nguồn trên internet giúp mang lại kiến thức khách quan dành cho bạn

©2022 darkedeneurope.com - Website WordPress vì mục đích cộng đồng

Liên Hệ - Giới Thiệu - Nội Quy - Bảo Mật

No Result
View All Result
  • Trang chủ
  • Chuyên mục
    • Hỏi Đáp
    • Kiến Thức
    • Sức Khỏe
    • Tử Vi
    • Công Nghệ
  • Lưu trữ
  • Liên hệ

© 2022 darkedeneurope.com - Website WordPress vì mục đích cộng đồng.