CentOS 6.2 use Yum to install lamp and phpMyAdmin detailed _php tips

Source: Internet
Author: User
Tags install php mcrypt phpmyadmin

Describes how to use the Yum configuration installed under the CentOs6.2 lamp environment, some brothers also like to use the installation method of compiling, personal feel if not to the server to do custom, with Yum installation stability simple, why go to Download&make&make What about install.

Step1. Configure Rpmforge and Epel sources for CentOS. CentOS official sources are also sufficient, but some extensions like PHP, such as Php-mcrypt, are not in the official source.
The Rpmforge source can be downloaded and installed in http://pkgs.repoforge.org/rpmforge-release/, named rpmforge-release-*.i686.rpm or rpmforge-release-*. X86_64.RPM, find the latest version.
Epel source can be found in http://mirrors.ustc.edu.cn/Fedora/epel/6/, 32 system in I386 folder, 64 bits in x86_64 folder, named epel-release-6-*. NOARCH.RPM, find the latest version.

Here is an example of a 32-bit system ,
#如果提示The requested URL returned error:404, please replace it with 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

Step 2. Install php/mysql/httpd
#安装apache  
yum-y install httpd httpd-devel   
#安装mysql  
yum-y install MySQL mysql-devel mysql-server mysql-libs 
#安装php  
yum-y install php 
#安装php扩展  
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   
#其它不常用php扩展, www.linuxidc.com do not have to install  
yum-y install php-pecl-memcache php-eaccelerator 
#安装phpmyadmin  
yum-y Install phpmyadmin  
#安装完成之后, start  
service httpd start 
Service mysqld start 

Step 3. Configure httpd, mysqld power-on self starter
Chkconfig mysqld on
Chkconfig httpd on

Step 4. Configure phpMyAdmin
Modify/usr/share/phpmyadmin/config.inc.php
#将这里abcde文字修改为自己的字符, can be arbitrary
$cfg [' blowfish_secret '] = ' ABCDE ';

FAQ
1. The phpMyAdmin hint did not open the Php-mcrypt because the php-mrcrpt extension was not installed. In the official source no PHP-MRCRPT extensions, please install Epel source and then yum install Php-mcrypt

2. phpMyAdmin Cannot access

phpMyAdmin can only be accessed by default using Http://localhost/phpmyadmin, and the corresponding part in/etc/httpd/conf.d/phpmyadmin.conf may be modified into
<directory "/usr/share/phpmyadmin" >
Order Deny,allow
# Deny from all
Allow from all
</Directory>
But it's strongly unsupported to do so, exposing phpmyadmin to unsafe

Note:
Apache Parse PHP, modify httpd.conf file, add
AddType application/x-httpd-php. php. phtml
AddType Application/x-httpd-php-source. Phps

MYQL can log on remotely
set MySQL password
mysql>; Use MySQL;
mysql>; UPDATE user SET Password=password (' newpassword ') WHERE user= ' root ';
mysql>; FLUSH privileges;
1.2.3 Allow remote logins
Mysql-u root-p
Enter Password: <your new password>
Mysql>grant all privileges in *.* to ' username ' @ '% ' identified by ' password ' with GRANT OPTION;
When you are done, you can remotely manage MySQL with Mysql-front.
Set to boot
Chkconfig mysqld on

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.