Home >Backend Development >PHP Tutorial >CentOS 6.2 uses yum to install LAMP and phpMyadmin

CentOS 6.2 uses yum to install LAMP and phpMyadmin

WBOY
WBOYOriginal
2016-07-25 08:54:461051browse
  1. #If The requested URL returned error: 404 is prompted, please change to the latest version
  2. rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2 .el6.rf.i686.rpm
  3. rpm -ivh http://download.Fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
Copy code

Steps 2. Install php/mysql/httpd

  1. #Install apache
  2. yum -y install httpd httpd-devel
  3. #Install mysql
  4. yum -y install mysql mysql-devel mysql-server mysql-libs
  5. #Install php
  6. yum -y install php
  7. #Install php extensions
  8. yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-mbstring php-devel php-soap php-cli php-pdo
  9. yum -y install php-mcrypt php-tidy php- xml php-xmlrpc php-pear
  10. #Other uncommon php extensions, www.linuxidc.com do not need to be installed
  11. yum -y install php-pecl-memcache php-eaccelerator
  12. #Install phpmyadmin
  13. yum -y install phpmyadmin
  14. #Installation completed After that, start
  15. service httpd start
  16. service mysqld start
Copy code

Step 3. Configure httpd and mysqld to start automatically at boot

  1. chkconfig mysqld on
  2. chkconfig httpd on
Copy code

Step 4. Configure phpmyadmin Modify /usr/share/phpmyadmin/config.inc.php

  1. # Modify the abcde text here to your own characters, you can arbitrarily
  2. $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

  1. Order Deny,Allow
  2. # Deny from all
  3. 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

  1. Addtype application/x-httpd-php .php .phtml
  2. Addtype application/x-httpd-php-source .phps
Copy code

myql can log in remotely and set mysql password:

  1. mysql>; USE mysql;
  2. mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
  3. mysql>; FLUSH PRIVILEGES;
Copy code

1.2 .3 Allow remote login

  1. mysql -u root -p
  2. Enter Password:
  3. 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:

  1. chkconfig mysqld on
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn