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.