Administrator
发布于 2018-08-10 / 4 阅读
0
0

Ubuntu 16.04安装Apache、MySQL、PHP

安装Apache

apt install apache2
apache2默认的站点根目录在/var/www/html,配置文件是/etc/apache2/apache2.conf/var/www/html默认是只读的,为了能在里面新建文件夹或者文件,修改访问的权限
chmod -R 777 /var/www/html
使用命令
/etc/init.d/apache2 restart
/etc/init.d/apache2 stop
/etc/init.d/apache2 start

安装MySQL

apt install mysql-server
查看MySQL服务的状态
service mysql status
停止、启动、重启MySQL服务
service mysql restart
service mysql stop
service mysql start
安装MySQL Workbench
apt install mysql-workbench

安装PHP

apt install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl
nano /var/www/html/info.php
在里面添加<?php phpinfo(); ?> 增加php7对mysql的支持
apt-cache search php7
/etc/init.d/apache2 restart

安装phpMyAdmin

apt install phpmyadmin
由于phpMyAdmin默认装在/usr/share/phpmyadmin,再执行如下命令:
ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
 

评论