Build a LAMP environment in ubuntu, using ubuntulamp
The main process is: Prepare the ubuntu server-> install MySQL-> install apache-> install PHP (the reason why php is installed after mysql and apache is because php depends on apache and mysql Services) first, it is necessary to update the software package resource sudo apt-get update.Step 1. Install MySQLSudo apt-get install mysql-server enter Y, press enter and enter the administrator password after installation, enter sudo netstat-tap | grep mysql Command. If the listening port is displayed, the installation is successful.Step 2. install apacheSudo apt-get apache2 enter Y and press Enter. After installation is complete, enter the Server ip address. If the apache Information page appears, the installation is successful.Step 3. install PHPSudo apt-get install php5 libapache2-mod-php5 Note: if the ubuntu server version is too high, such as ubuntu 16.04 or later, these versions of the built-in software package is PHP7, to install a lower version of PHP, run the following command to install sudo add-apt-repository ppa: ondrej/php sudo apt-get update sudo apt-get install php5.6 libapache2-mod-php5.6 after installation can test whether the success, directory location/var/www then install some extensions of PHP sudo apt-get install php5.6-mysql php5.6-curl php5.6-gd php5.6-intl php-pear php-imagick php5.6-imap php5.6-mcrypt php-memcache php5.6-pspell php5.6-recode php5.6-snmp php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl; after installation, you must go to the PHP configuration file php. enable these extensions in ini, and then restart apache to output phpinfo () in the Code. Check whether the related extensions have been installed successfully and restart the apache Command service apache2 restart.