-
- #If The requested URL returned error: 404 is prompted, please change to the latest version
- rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2 .el6.rf.i686.rpm
- rpm -ivh http://download.Fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
Copy code
Steps 2. Install php/mysql/httpd
-
- #Install apache
- yum -y install httpd httpd-devel
- #Install mysql
- yum -y install mysql mysql-devel mysql-server mysql-libs
- #Install php
- yum -y install php
- #Install php extensions
- yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-mbstring php-devel php-soap php-cli php-pdo
- yum -y install php-mcrypt php-tidy php- xml php-xmlrpc php-pear
- #Other uncommon php extensions, www.linuxidc.com do not need to be installed
- yum -y install php-pecl-memcache php-eaccelerator
- #Install phpmyadmin
- yum -y install phpmyadmin
- #Installation completed After that, start
- service httpd start
- service mysqld start
Copy code
Step 3. Configure httpd and mysqld to start automatically at boot
-
- chkconfig mysqld on
- chkconfig httpd on
Copy code
Step 4. Configure phpmyadmin
Modify /usr/share/phpmyadmin/config.inc.php
-
- # Modify the abcde text here to your own characters, you can arbitrarily
- $cfg['blowfish_secret'] = 'abcde';
Copy the code
The following introduces the problems encountered in the yum installation lamp environment common problem.
1. phpmyadmin prompts that php-mcrypt is not enabled. This is because the php-mrcrpt extension is not installed.
There is no php-mrcrpt extension in the official source. Please install the epel source and then yum install php-mcrypt.
2, phpmyadmin cannot be accessed
By default, phpmyadmin can only be accessed using http://localhost/phpmyadmin. You can modify the corresponding part in /etc/httpd/conf.d/phpmyadmin.conf as
-
-
- Order Deny,Allow
- # Deny from all
- Allow from All
-
Copy code
Highly not recommended By doing this, it is unsafe to expose phpmyadmin.
Note:
Apache parses php, modifies the httpd.conf file, and adds
-
- Addtype application/x-httpd-php .php .phtml
- Addtype application/x-httpd-php-source .phps
Copy code
myql can log in remotely and set mysql password:
-
- mysql>; USE mysql;
- mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
- mysql>; FLUSH PRIVILEGES;
Copy code
1.2 .3 Allow remote login
-
- mysql -u root -p
- Enter Password:
- mysql>GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
Copy the code
After completion, you can use mysql-front to remotely manage the mysql database.
Set mysql to start at boot:
|