Ubuntu 16.04 apache+php+mysql Environment Building

Source: Internet
Author: User
Tags install php phpinfo

16.04 the method of installation is almost the same as the previous versions.


First install Apache:

sudo apt-get install apache2


After the installation is complete, restart the service:

/etc/init.d/apache2 restart

Enter your password, the screen displays the following words indicating that the restart is complete:

[....] Restarting Apache2 (via Systemctl): Apache2.service

= = = Authenticating for org.freedesktop.systemd1.manage-units = = =

Authentication is required to restart ' Apache2.service '.

Authenticating As:wagner,,, (Wagner)

Password:

= = = Authentication Complete = =

. Ok


Then, using the browser input 127.0.0.1 try to enter the Apache welcome interface, if entered, it means that Apache installation success.


Then install PHP:

sudo apt-get install php7.0

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

Under/var/www/html/Path, create a new phpinfo.php with the following content:

<?php

Phpinfo ();

?>


Enter 127.0.0.1/phpinfo.php in the browser

If you successfully see the list information for PHP, the installation is successful


Finally, install MySQL:

sudo apt-get install Mysql-server

sudo apt-get install Php7.0-mysql


Terminal input Mysql-u root-p, then enter the password set at installation, enter the mysql> command prompt, indicating that the installation was successful.

Ubuntu 16.04 apache+php+mysql Environment Building

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.