Installing the PHP lamp environment with Yum

Source: Internet
Author: User
CentOS 6.5 uses Yum to install lamp (PHP operating environment)

Today with the Yum method built a lamp environment, encountered a lot of problems, after Google and the help of predecessors, finally set up the environment, now the complete steps to record down,


2. Install apache,mysql,php with Yum.
2.1 Installing Apache
Yum Install httpd Httpd-devel
When the installation is complete, start Apache with/etc/init.d/httpd start
Set to boot: Chkconfig httpd on
2.2 Installing MySQL
2.2.1 Yum install MySQL mysql-server mysql-devel
Again, when done, start MySQL with/etc/init.d/mysqld start
2.2.2 Setting the MySQL password
mysql>; Use MySQL;
mysql>; UPDATE user SET Password=password (' newpassword ') WHERE user= ' root ';
mysql>; FLUSH privileges;
2.2.3 Allow remote logins
Mysql-u root-p
Enter Password:
Mysql>grant all privileges on * * to ' user name ' @ '% ' identified by ' password ' with GRANT OPTION;
When you're done, you can manage MySQL remotely with Mysql-front.
2.2.4 Set to boot
Chkconfig mysqld on
3. Install PHP
Yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/ETC/INIT.D/HTTPD start
4. Test
4.1 Create a new test.php file in/var/www/html/, write the following, and then save.
Phpinfo ();
?>
4.2 Firewall configuration
A. Add. Allow access to port {21:ftp, 80:http}.
Iptables-i rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 21-j ACCEPT
Iptables-i rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT
B. Turn off firewall {not recommended}.
Service Iptables Stop
C. Resetting the load firewall
Service Iptables Restart
4.3 Then open the http://serverip/test.php in the client browser, if the successful display, it means that the installation is successful.
This completes the installation. Feeling that Yum is really good.

The above describes the use of Yum installed PHP lamp environment, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.