Ubuntu Virtual Machine Build Web server

Source: Internet
Author: User
Tags php write

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.