Home > Backend Development > PHP7 > Introduction to how to install PHP7 on Ubuntu

Introduction to how to install PHP7 on Ubuntu

藏色散人
Release: 2023-02-17 17:52:02
Original
3615 people have browsed it

How to install php7 on Ubuntu: First install PHP7 and common extensions through the command "sudo apt-get install"; then enable Apache's php7.0 module; then start the php7.0-fpm process; and finally test whether PHP The installation is successful.

Introduction to how to install PHP7 on Ubuntu

InstallationPHP7

Ubuntu 16.04 officially comes with PHP7, so you can use it directly apt-get to install.

(1) Install PHP7 and common extensions.

sudo apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-mbstring php7.0-gd php7.0-json php7.0-cli php7.0-curl libapache2-mod-php7.0
Copy after login

(2) Enable Apache’s php7.0 module, and then restart Apache.

sudo a2enmod php7.0
sudo systemctl restart apache2
Copy after login

(3) Start the php7.0-fpm process.

sudo systemctl start php7.0-fpm
Copy after login

(4) Check the running status of php7.0-fpm.

systemctl status php7.0-fpm
Copy after login

Introduction to how to install PHP7 on Ubuntu

(5) Test whether PHP is installed successfully

php -v
或
php --version
Copy after login

Introduction to how to install PHP7 on Ubuntu

The above is the detailed content of Introduction to how to install PHP7 on Ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template