ubuntu-kylin16.04 Build lamp environment.

Source: Internet
Author: User
Tags install php phpinfo phpmyadmin

First Download Install Apache2

Input: sudo apt-get install apache2

After the installation is complete, enter in the browser: localhost displays as follows, stating that the installation is correct.

Immediately after installation php7.0

Input: sudo apt-get install php7.0

Once the installation is complete, install MySQL

Input: sudo apt-get install Mysql-server

4. Install additional modules

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

Restart Service

service apache2 restart

service mysql restart

Test Apache can parse PHP

在/var/www/html/中新建一个名为phpinfo.php的文件

The file reads:

<?php

echo phpinfo();

?>

Browser access: http://localhost/phpinfo.php , the PHP version page appears

5. Modify Permissions

sudo chmod 777 /var/www

6. Installing phpMyAdmin

sudo apt-get install phpmyadmin

Install: Select Apache2, click OK. The next option is to configure the database and enter the password.

To create a phpMyAdmin shortcut:sudo ln -s /usr/share/phpmyadmin /var/www/html

To enable the Apache mod_rewrite module:sudo a2enmod rewrite

Restart Service:

service php7.0-fpm restart

service apache2 restart

Test: Browser access:http://localhost/phpmyadmin

If you follow the author's thinking step by step to do now then you should be visiting localhost/phpmyadmin, of course, is likely to error, this time will prompt you do not install an extension mbstring, according to the page error message download the corresponding expansion

# sudo apt install sudo apt-get install php-mbstring php7.0-mbstring

A new error message may be added: PHP Fatal error:require_once (): ... A new installation is also required to expand

sudo apt-get install php-gettextsudo service apache2 reload/restart
lamp环境就搭好了
查看资料:http://www.linuxidc.com/Linux/2016-10/136327.htm
http://www.laixiaojieblog.cn/2016/05/28/ubuntu-16-04-lamp%E7%8E%AF%E5%A2%83%E6%89%8B%E5%8A%A8%E9%85%8D%E7%BD%AE%E4%BB%A5%E5%8F%8A%E9%97%AE%E9%A2%98%E8%A7%A3%E6%9E%90/

ubuntu-kylin16.04 Build lamp environment.

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.