Build Apache, MySQL, and PHP in the LAMP environment in Ubuntu
As I just learned about Linux, I chose Ubuntu, which has a friendly interface, for research. Command line + visualization is a good combination for beginners. The graphic interface can be used as a transition of command lines to see the effect intuitively. Learning in applications is a good way. I learned how to build a Linux-based server environment and completed LAMP Configuration Based on the information collected on the Internet.
The main process is as follows:
1. the installation sequence of LAMP is incorrect. Now the Linux system is installed by default, and my version is Ubuntu 12. 04. generally, we recommend that you install PHP in the final order of Mysql Apache. In my practice, the order of Apache and Mysql can be reversed, because the dependencies between the two are not very strong, but PHP should be installed after the two, because it depends on Apache and Mysql services.
2. install MysSQL: Open the command line and enter sudo apt-get install mysql-server. Enter the administrator password and select Y.
During installation, a prompt is displayed, indicating that the Mysql administrator password is entered. Set the Mysql password:
View the service after installation: Enter sudo netstat-tap | grep mysql to display the listening port, indicating that the installation is successful.
3. install Apache by entering sudo apt-get install apache2 in the command line and selecting Y
Check whether the installation is successful: Open the local browser and enter the interface 127.0.0.1, indicating that the installation is successful.
4. install PHP input sudo apt-get install php5 libapache2-mod-php5
After the installation is complete, test whether the installation is successful:
First, you must change the ownership of the www directory so that you can enter sudo chmod 777/var/www in the new document.
Create a new document: sudo vi/var/www/info. php
Press I to edit the file input.
<? Php
Phpinfo ();
?>
After ESC, enter: wq to save and exit.
Restart Apache: Enter sudo/etc/init. d/apache2 restart.
Enter 127.0.0.1/phpinfo. php In the browser. If the PHP configuration information appears, it indicates that the configuration is successful.
5. Finally, install the related PHP and Mysql extension packages:
Sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy;
6. To facilitate database management, we recommend that you install phpmyadmin. Enter sudo apt-get install phpmyadmin in the command line. A prompt is displayed in the middle. Enter the management password as prompted.
After the installation is complete, copy the phpmyadmin folder to the www file for management: sudo cp/usr/share/phpmyadmin/var/www-
Enter http: // 127.0.0.1/phpmyadmin in the browser and the following page appears.
Now the basic environment has been set up. If you have a step to renew it, it is recommended that you search for it. The overall installation is still relatively smooth.
Finally, it can be seen that the installation environment in Linux is much more convenient than that in windows, and there is no need to configure environment variables and other compatibility things, which greatly improves the efficiency.
You may also like the following LAMP-related content:
Install Xcache and Memcached on the LAMP platform to accelerate website operation
Build a LAMP platform environment in CentOS 7
CentOS 6.5 system installation and configuration LAMP (Apache + PHP5 + MySQL) server environment
Configure the LAMP + phpMyAdmin PHP (5.5.9) development environment in Ubuntu 14.04
Install LAMP in Ubuntu 14.10
LAMP combines NFS to build a small blog site