MENU

ubuntu 16 安装lamp环境

ubuntu pc装lamp环境

mysql

sudo apt-get install mysql-client-5.6
sudo apt-get install mysql-server-5.6

apache

sudo apt-get install apache2

php 7

sudo apt-get install php7.0 libapache2-mod-php7.0  libapache2-mod-php
#ubuntu16.04中没有php5,直接php7

cat /var/www/html/info.php

<?php
phpinfo();
?>

安装php5 ...

Error: WeCenter not support PHP version 6 currently

** 站点不支持7.0 导入php源重新安装**

sudo apt-get remove php7.0 libapache2-mod-php7.0  libapache2-mod-php
#卸载
sudo add-apt-repository ppa:ondrej/php
#回车...
sudo apt-get update
sudo apt-get install php5.6

sudo apt-get install php5.6-gd php5.6-mysql libapache2-mod-php
#安装依赖包

启动apache服务

sudo vi /etc/apache2/sites-enabled/000-default.conf

DirectoryIndex  index.php index.html
#DocumentRoot 下面加一个默认文档...
sudo chown www-data /var/www/html/ -R
#站点apache运行用户
sudo /etc/init.d/apache2  restart
#运行apache服务

Tags: None
Archives QR Code
QR Code for this page
Tipping QR Code
Leave a Comment