在centos上安装php5.5+MySQL 5.5.32

在centos直接使用yum install 安装php的话版本比较低,如果需要高版本的话,请看如下:

Step 1: Installing Remi Repository

  1. ## Install Remi & Epel Repository on RHEL/CentOS 6.4-6.0 - 32 Bit ##
  2. rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
  3. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  4. ## Install Remi & Epel Repository on RHEL/CentOS 6.4-6.0 - 64 Bit ##
  5. rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  6. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  7. ## Install Remi Repository on RHEL/CentOS 5.9-5.0 - 32 Bit ##
  8. rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
  9. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
  10. ## Install Remi Repository on RHEL/CentOS 5.9-5.0 - 64 Bit ##
  11. rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
  12. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

Step 2: Installing Apache, MySQL 5.5.32 & PHP 5.5.0

  1. ## Installing on RHEL/CentOS 5-6 ##
  2. # yum --enablerepo=remi,remi-test install httpd mysql mysql-server php php-common

Step 3: Installing PHP 5.5.0 Modules

  1. ## Installing on RHEL/CentOS 5-6 ##
  2. # yum --enablerepo=remi,remi-test install php-mysql php-pgsql php-pecl-mongo php-sqlite
  3. php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli
  4. php-pear php-pdo

Step 4: Starting/Stopping Apache & MySQL 5.5.32

  1. ## Enable Apache and MySQL on Run-Levels ##
  2. # chkconfig --levels 235 httpd on
  3. # chkconfig --levels 235 mysqld on
  4. ## Apache Commands ##
  5. # /etc/init.d/httpd start
  6. # /etc/init.d/httpd stop
  7. # /etc/init.d/httpd status
  8. ## MySQL Commands ##
  9. # /etc/init.d/mysqld start
  10. # /etc/init.d/mysqld stop
  11. # /etc/init.d/mysqld status
  12. 好了差不多了,配置测试之类网上很多资料!!!