ubuntu16.04 Installation Configuration Php5.6,apache2,mysql

Source: Internet
Author: User

Ubuntu 16.04 Default installation php7.0 environment, but PHP7 current compatibility is not very good, if you install php5 need to clear PHP7 installed package, otherwise will error.

First step: Remove the default and installed PHP packages

sudo dpkg-l | grep php| awk ' {print $} ' |tr ' \ n ' ""
sudo apt-get install aptitude
sudo aptitude purge ' dpkg-l | grep php| awk ' {print $} ' |tr ' \ n ' "" '

Step two: Add PPA, install php5.6

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6

sudo php-v to view the installation version

Step Three: Install Apache2

The previous step will be installed by default, if not, execute the following command to install

sudo apt install apache2
sudo apt-get install libapache2-mod-php5.6

Step three: Install MySQL

sudo apt install mysql-server mysql-client php5.6-mysql
Mysql_secure_installation

Running Mysql_secure_installation will perform several settings:
A) set a password for the root user
b) Delete Anonymous account
c) Remove the root user from remote login
d) Delete the test library and access to the test library
e) Refresh the authorization form for the changes to take effect

These settings can improve the security of the MySQL library.

Fourth Step: Install phpMyAdmin

sudo apt-get install phpMyAdmin php5.6-mbstring php5.6-gettext

sudo ln-s/usr/share/phpmyadmin/var/www/html/phpmyadmin

Fifth Step: Configure phpMyAdmin
Nano/etc/php/5.6/apache2/php.ini
Display_errors = On (error log appears, two times, change, otherwise invalid)
Extension=php_mbstring.dll (Open mbstring)
sudo dpkg-reconfigure phpmyadmin (reconfiguration phpMyAdmin)

ubuntu16.04 Installation Configuration Php5.6,apache2,mysql

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.