Build an ubuntu lamp (apache + mysql + php) Environment

Source: Internet
Author: User


Ubuntu lamp (apache + mysql + php) Environment setup I. Environment installation 1. install apache2 sudo apt-get install apache2 and open http: // localhost/or http: // 127.0.0.1 in the browser! Verify that apache is successfully installed. Www.2cto.com 2. install PHP sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 sudo/etc/init. d/apache2 restart
Test: Writing sudo vi/var/www/testphp. php to php works! Save and exit vi. Then input http: // 127.0.0.1/testphp. php or http: // localhost/testphp. php In the browser If php works is displayed! Indicates that the php configuration is successful. 3. install MYSQL sudo apt-get install mysql-server and set the root password as prompted during installation.
Note: change the password: mysql-uroot-p mysql> use mysql; mysql> update user set PASSWORD = password ('new password') WHERE user = 'root '; mysql> exit to restart mysql, or refresh the permission to restart: sudo/etc/init. d/mysql restart or restart mysql
4, let apache, php support mysql sudo apt-get install libapache2-mod-auth-mysql sudo apt-get install php5-mysql sudo/etc/init. d/apache2 restart now Ubuntu + apache2 + php 5 + mysql installation is complete. Tip:/etc/apache2/: 1. apache2.conf is the main configuration file, httpd. conf user configuration file 2. The virtual directory is in httpd. in the conf file, DocumentRoot "path" ServerName # Listen 127.0.0.1: 80 # note that you cannot write a listener in this file. If you must write a listener, you need to first include/etc/apache2/ports under apache2.conf. conf to comment out, because ports. port 80 has been monitored in conf
3. Set the directory to/etc/apache2/sites-enabled/000-default. You can set the VM 4 and php. ini:/etc/php5/apache2/php. ini 5, mysql. cnf:/etc/mysql/my. cnf 4. Restart apache:/etc/init. d/apache2 restart 5. restart mysql: sudo/etc/init. d/mysql restart or restart mysql 6. log File:/var/log/apache2/
Ii. install sudo apt-get install php5-gd sudo/etc/init in GD library. d/apache2 restart 3. curl extension install sudo apt-get install php5-curl sudo/etc/init. d/apache2 restart

Related Article

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.