Home > Backend Development > PHP Problem > How to set up a PHP environment under Ubuntu system?

How to set up a PHP environment under Ubuntu system?

coldplay.xixi
Release: 2023-03-03 06:12:02
Original
4137 people have browsed it

How to build a php environment under the ubuntu system: first install Apache2 and install the PHP module; then install the database and select papche2 and lighttpd; then enter the password of the mysql database and set the management password; finally enter [php - v] Just check the PHP version.

How to set up a PHP environment under Ubuntu system?

How to build a php environment under the ubuntu system:

1. Install Apache2:

sudo apt-get install apache2

How to set up a PHP environment under Ubuntu system?

2. Install PHP module:

sudo apt-get install php7.0

How to set up a PHP environment under Ubuntu system?

3. Install the database:

sudo apt install -y mysql-server mysql-client

Use mysql -u root -p to log in to the database

How to set up a PHP environment under Ubuntu system?

4. Installation of some other modules:

sudo apt-get install libapache2-mod-php7.0

sudo apt-get install php7.0-mysql

sudo apt-get install php7.0-gd

sudo apt-get install phpmyadmin

How to set up a PHP environment under Ubuntu system?

How to set up a PHP environment under Ubuntu system?

How to set up a PHP environment under Ubuntu system?

How to set up a PHP environment under Ubuntu system?

5. During the period, you will be asked to select papche2 and lighttpd. Press the space to select papche2 and press Enter to confirm

How to set up a PHP environment under Ubuntu system?

6. You need to enter the password of the mysql database

How to set up a PHP environment under Ubuntu system?

7. You need to set the management password

How to set up a PHP environment under Ubuntu system?

8. Enter php -v to view the PHP version

How to set up a PHP environment under Ubuntu system?

Related learning recommendations: PHP programming from entry to proficiency

The above is the detailed content of How to set up a PHP environment under Ubuntu system?. 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