Ubuntu16.04.1搭建LAMP开发环境

2016-11-19 03:51:13 6145

1.更新

sudo apt-get update

Ubuntu16.04.1搭建LAMP开发环境

2.安装apache

sudo apt-get install apache2

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

3.安装MySQL

sudo apt install mysql-server mysql-client

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

输入密码,Tab键,回车

Ubuntu16.04.1搭建LAMP开发环境

输入确认密码,Tab键,回车

Ubuntu16.04.1搭建LAMP开发环境

4.

sudo mysql_secure_installation

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

5.安装PHP7.0

sudo apt install php7.0 php7.0-mysql php7.0-curl php7.0-gd php7.0-mbstring php-gettext php7.0-mcrypt php7.0-xmlrpc libapache2-mod-php7.0

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

6.配置Apache服务器

sudo vi /etc/apache2/mods-enabled/dir.conf

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

7.重启Apache服务器

sudo systemctl restart apache2

Ubuntu16.04.1搭建LAMP开发环境

8.

sudo find /var/www/html/-type d -exec chmod 755 {} ;

sudo find /var/www/html/-type f -exec chmod 644 {} ;

Ubuntu16.04.1搭建LAMP开发环境

9.查看PHP版本

php -v

Ubuntu16.04.1搭建LAMP开发环境

10.到这里安装完成了,测试,在浏览器地址栏输入localhost。

sudo vi /var/www/html/index.php

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

Ubuntu16.04.1搭建LAMP开发环境

大功告成。


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: