About Ubuntu Building PHP Development Environment Example Tutorial

Source: Internet
Author: User
This article mainly share with you about Ubuntu build PHP Development Environment Example Tutorial, followed this article to learn to help you complete the Ubuntu build PHP development environment.

Apache Installation

Install Apache server first, use Apt-get to download and install software under Ubuntu.

  

After you enter your password, you are ready to download the installation, open the browser after installation, enter localhost to see if the installation was successful.

  

If shown above, the installation was successful.

PHP Installation

Here I am going to install the PHP7.0 version, at the command line input: sudo apt-get install php7.0

  

After the installation is complete, enter: php-v to see if PHP is installed successfully

  

PHP and Apache are installed after the need to enable Apache to identify the parsing PHP files, we first search for a suitable PHP7 plug-in, input command: Apt-cache search libapache2-mod-php

  

You can see that there is a PHP7.0 version of the results, we will install this: sudo apt-get install libapache2-mod-php7.0

  

Below we can write a PHP file to see if you can parse the access. Input command: cd/var/www/html switch to Apache project directory, new file: sudo vim test.php

  

Save after browser access: localhost/test.php

  

If everything works, you'll see some information about PHP.

MySQL Installation

The next step is to install the database MySQL, the database needs to install server and client two, input command: sudo apt-get install mysql-server mysql-client

  

During installation, you will be prompted to set the login password for the root account, then select OK to continue the installation

  

After the installation is complete, enter MYSQL-V to view the installed version information

  

Again, we need MySQL to be able to interact with PHP and install PHP's MySQL plugin: sudo apt-get install Php7.0-mysql

  

Finally, we can also install some common PHP extensions

  

The software on the lamp is installed, and the Composer:sudo apt-get install composer can be installed at the end.

  

After installation, enter the command: composer to see if it is successful.

  

Display, the installation process is complete.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.