Ubuntu搭建LAMP环境(PHP5.6版本)

环境:ubuntu 16.04

1.安装apache

apt update
apt upgrade
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
apt install apache2

打开ip地址查看,如果是本地搭建的话就是输入127.0.0.1

2.mysql的安装

apt install mysql-server mysql-client

输入mysql -uroot -p验证

3.安装php5.6

apt update
apt upgrade
apt install php5.6
apt install libapache2-mod-php5.6  
apt install php5.6-mysql php5.6-mbstring php5.6-mcrypt php5.6-xml

验证方法:

vim /var/www/html/info.php
<?php
phpinfo();
?>

4.安装phpmyadmin

apt install phpmyadmin
cp -r /usr/share/phpmyadmin/ /var/www/html/
service apache2 restart

验证:

输入地址/phpmyadmin

ps:127.0.0.1/phpmyadmin

为您推荐

发表评论

电子邮件地址不会被公开。 必填项已用*标注