: This article describes how to use yum to install the phplamp environment. if you are interested in the PHP Tutorial, refer to it. CentOS 6.5 uses yum to install LAMP (php runtime environment)
Today, we set up a LAMP environment using the yum method, and encountered many problems. with the help of google and its predecessors, we finally set up the environment. now we have recorded the complete steps,
2. install Apache, Mysql, and PHP with yum.
2.1 install Apache
Yum install httpd-devel
After the installation is complete, start apache with/etc/init. d/httpd start
Set to boot: chkconfig httpd on
2.2 install mysql
2.2.1 yum install mysql-server mysql-devel
Similarly, start mysql with/etc/init. d/mysqld start
2.2.2 set the mysql password
Mysql>; USE mysql;
Mysql>; UPDATE user SET Password = PASSWORD ('newpassword') WHERE user = 'root ';
Mysql>; flush privileges;
2.2.3 allow remote logon
Mysql-u root-p
Enter Password:
Mysql> grant all privileges on *. * TO 'username '@' % 'identified by 'password' with grant option;
After that, you can use mysql-front to remotely manage mysql.
2.2.4 set to boot
Chkconfig mysqld on
3. install php
Yum install php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/Etc/init. d/httpd start
4. test it.
4.1 create a test. php file in/var/www/html/, write the following content, and save the file.
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. disable the firewall {not recommended }.
Service iptables stop
C. reset and load the firewall
Service iptables restart
4.3 then open http: // serverip/test. php in the client browser. if it is displayed successfully, the installation is successful.
So far, the installation is complete. Yum is so easy to use.
The above section describes how to use yum to install the php lamp environment, including some content. if you are interested in the PHP Tutorial.