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

Jul 25, 2016 am 08:54 AM

  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. <Directory "/usr/share/phpmyadmin">
  2. Order Deny,Allow
  3. # Deny from all
  4. Allow from All
  5. </Directory>
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: <your new 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 of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

11 Best PHP URL Shortener Scripts (Free and Premium)

Introduction to the Instagram API Introduction to the Instagram API Mar 02, 2025 am 09:32 AM

Introduction to the Instagram API

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Working with Flash Session Data in Laravel

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

Build a React App With a Laravel Back End: Part 2, React

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

12 Best PHP Chat Scripts on CodeCanyon

Notifications in Laravel Notifications in Laravel Mar 04, 2025 am 09:22 AM

Notifications in Laravel

See all articles