lamp,php Environment Preparation

Source: Internet
Author: User
lamp,php Environment Construction
Install MYSQL5 + Apache2 + php5+phpmyadmin using the Apt-get method:
Please look at the Ubuntu wiki First, (http://wiki.ubuntu.org) above is very detailed. But I did not succeed by doing the first time. APACHE2,PHP5,MYSQL5 can run, that is, phpMyAdmin is not available.
I get the experience is: MySQL ann successful, must first give it a password, this step is not few.
This article only represents personal views and experience, may be partial and error, please criticize correct, there are problems to discuss together!!
1. To install with Apt-get, the best, it may be necessary to run the following in order to upgrade their own system, I can only upgrade before installing MYSQL5 + Apache2 + PHP5.
I ran sudo apt-get install apache2 php5 mysql-server before the upgrade was no use. If you are looking for a bad source or if your network is unstable, you may not be able to upgrade. In this case, you may not be able to install some software when you want to install it in a apt-get way.
sudo apt-get update
sudo apt-get dist-upgrade
2. Installation:
sudo apt-get install Mysql-server
Installing the MYSQL5
sudo apt-get install apache2
Installing Apache2
sudo apt-get install php5
Installing PHP5
sudo apt-get install Php5-mysql
Installing the MySQL module for PHP
sudo apt-get install PHP5-GD
Installing the GD Library
When running the above command, you can look at the Libapache2-mod-auth-mysql (installation Apache2 may be installed) and LIBAPACHE2-MOD-PHP5, if you see the installation will not be installed separately.
3. Configuration:
We just installed the MySQL, only one system default root user, and there is no password, at this time we must give MySQL set a password, personally think must. Because the first time I installed it is not to do this step, think and win under the same, can not set the first. But when I http://127.0.0.1/phpmyadmin under the root without a password to login, how will not succeed!
Under Terminal input:
Mysql-u Root
Mysql> GRANT All privileges on * * to [e-mail protected] identified by "[email protected]";
[email protected], can be set freely, but it is better to set a safe point.
Mysql>\q quit MySQL
MySQL configuration file-my.cnf: (Path:/ETC/MYSQL/MY.CNF)
Run command: sudo gedit/etc/mysql/my.cnf can be edited.
Apache2 configuration file-apache2.conf (path:/etc/apache2/apache2.conf)
Run command: sudo gedit/etc/apache2.conf editable
PHP configuration file-php.ini: (Path:/etc/php5/apache2/php.ini)
Run command: sudo gedit/etc/php5/apache2/php.ini can be edited.
At this time, these three files are not edited, such as for the sake of security and optimization, it must be edited. Specific people can visit other information, this article not much to say!!
4. Installing phpMyAdmin
sudo apt-get install phpMyAdmin
Installation is ready to test: Http://127.0.0.1/phpmyadmin when the interface on the line, temporarily do not log in, and so change your phpmyadmin configuration file (config.inc.php) and then login.
Terminal input: sudo gedit/etc/phpmyadmin/config.inc.php
Find $cfg[' Servers ' [$i] [' Password ']= ';
Change to: $cfg [' Servers '] [$i] [' Password ']= [email protected] ';
[Email protected]
5. It's a good idea to restart your computer at this point, (as you can see in the Web, it's the second time you install) Open your browser http://localhost/phpmyadmin/
User name Enter root, enter the password you just changed, and then execute
Can see in win that amiable phpmyadmin face.
Summary:
Apache2 Operation Command:
Start: Sudo/etc/init.d/apache2 start
Restart: sudo/etc/init.d/apache2 restart
Close: Sudo/etc/init.d/apache2 stop
Default home directory for apache2:/var/www/




This article comes from Chinaunix blog, if you look at the original point: http://blog.chinaunix.net/u/13834/showart_493981.html
  • 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.