Install Apache service First
sudo apt-get install apache2
Open Browser, address bar input localhost display the following interface indicates a successful installation
Since Ubuntu comes with php7.0 version, and we need php5.6 version, we need to switch to php5.6 version.
*sudo add-apt-repository ppa:ondrej/php?? #添加源
sudo apt-get update???? #安装php5.6
sudo apt-get install php5.6
sudo apt-get install libapache2-mod-php5.6
sudo apt-get install php5.6-mysql php5.6-mbstring php5.6-mcrypt php5.6-xml
sudo a2dismod php7.0????? #切换版本
sudo a2enmod php5.6
sudo service apache2 restartupdate-alternatives--set php/usr/bin/php5.6*
Enter Php-v to view the current PHP version.
Installing the MySQL Service
sudo apt-get install mysql-server mysql-client
* * Restart Apache service? /etc/init.d/apache2 restart
Need to reconfigure phpMyAdmin to manage MySQL database * *
sudo dpkg-reconfigure phpmyadmin
Switch to the/var/www/html directory, which is the default document for Apache to create a info.php write in the current folder <?php Phpinfo ()?> and then open the localhost/info.php in the browser You can view the current configuration information.
Open the browser, enter/localhost/phpmyadmin to manage the MySQL database, the account is root, the password is just installed MySQL password. Here, the server Setup is complete.
Ubuntu Virtual Machine Build Web server