Ubuntu16.04 configure php environment

#Enter root privileges
sudo su
#php environment construction
apt-get install apache2
add-apt-repository -y ppa:ondrej/php
apt update
apt install  php7.0
apt install -y mysql-server mysql-client
apt-get install libapache2-mod-php7.0
apt-get install php7.0-mysql
dpkg-reconfigure  php7.0-mysql
apt-get install php7.0-xml
apt-get install php7.0-gd
apt-get install phpmyadmin
During the installation process, you will be asked to select Web server: apache2 or lighttpd, use the space bar to select apache2, and then confirm, enter the password you just set when installing Mysql in the following interface, and confirm. Confirm the Mysql password again, OK.
Then connect phpmyadmin to apache2,
sudo ln -s /usr/share/phpmyadmin  /var/www/html
restart apache2
sudo /etc/init.d/apache2  restart
 
other
restart mysql
/etc/init.d/mysql restart

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325358374&siteId=291194637