Ubuntu 16.04 apt-get搭建LAMP环境
来源:互联网 发布:网络剪刀手破解版 编辑:程序博客网 时间:2024/05/14 01:58
本文重点介绍在Ubuntu中使用apt-get安装LAMP(Ubuntu 16.04,Apache2.4.18,mysql5.7.12,php7.0.4)环境,所以不再介绍如何安装Ubuntu。
安装Apache:1
weirubo@weirubo-VirtualBox:~$
sudo
apt-get
install
apache2
1
weirubo@weirubo-VirtualBox:~$ apache2 -
v
2
Server version: Apache/2.4.18 (Ubuntu)
3
Server built: 2016-04-15T18:00:57
http://192.168.199.232/
安装PHP7:
1
weirubo@weirubo-VirtualBox:~$
sudo
apt-get
install
php7.0
1
weirubo@weirubo-VirtualBox:~$ php7.0 -
v
2
PHP 7.0.4-7ubuntu2 (cli) ( NTS )
3
Copyright (c) 1997-2016 The PHP Group
4
<a href=
"http://www.php-z.com/"
target=
"_blank"
class=
"relatedlink"
>Zend</a> Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
5
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
安装libapache2-mod-php7.0:
1
weirubo@weirubo-VirtualBox:~$
sudo
apt-get
install
libapache2-mod-php7.0
查看libapache2-mod-php7.0是否安装成功:
1
weirubo@weirubo-VirtualBox:~$
cat
/etc/apache2/mods-enabled/php7.0.load
2
# Conflicts: php5
3
LoadModule php7_module /usr/lib/apache2/modules/libphp7.0.so
安装MySQL:
1
weirubo@weirubo-VirtualBox:~$
sudo
apt-get
install
mysql-server
安装php7.0-mysql:
1
weirubo@weirubo-VirtualBox:~$
sudo
apt-get
install
php7.0-mysql
1
weirubo@weirubo-VirtualBox:~$
sudo
service mysql restart
1
weirubo@weirubo-VirtualBox:~$
sudo
service apache2 restart
新建一个php文件,phpinfo.php
1
weirubo@weirubo-VirtualBox:~$
sudo
vim /var/www/html/phpinfo.php
输入php代码,保存并退出:
1
<?php
2
echo
phpinfo();
3
?>
http://192.168.199.232/phpinfo.php
0 0
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get 搭建 LAMP 环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- Ubuntu 16.04 apt-get搭建LAMP环境
- ubuntu环境安装lamp-apt-get安装
- Ubuntu 16.04 LTS下用apt搭建LAMP环境
- Ubuntu 16.04搭建lamp环境
- Ubuntu中使用apt-get安装LAMP
- malloc实现原理和内存碎片
- jQuery--获取/设置CSS类
- C/C++——静态链接库
- pat甲1013. Battle Over Cities(dfs)
- JDBC连接数据库的过程
- Ubuntu 16.04 apt-get搭建LAMP环境
- BZOJ1488: [HNOI2009]图的同构
- malloc()、calloc()以及ralloc()
- 利用指针和迭代器遍历二维数组的2种方法
- AVAudioSession应用指南
- jQuery--追加/删除 元素
- relloc calloc 如何使用 注意事项
- c++学习(五):new char[]的赋值
- 【Python错误】 'ascii' codec can't decode byte 0xe7 in position 0: ordinal not in range(128)