Install PHP 5.3 on CentOS 5.6
This article will outline the process for install PHP 5.3.x on CentOS 5.6 via the Enterprise Linux (EPEL) repository.
System Update
First of all, complete a yum update on your machine by running:
# yum update
If a kernel update occurs I recommend rebooting before completing the rest of the steps in this outline.
Install Repositories
In order to upgrade your PHP and MySQL environment you will need to install two repositories, one from the Fedora site and one from Famillecollet (remi).
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
Apache & PHP Update
Once the repo’s are installed you can complete the install (or upgrade) of MySQL, Apache and PHP:
# yum –enablerepo=remi install mysql-server
# yum –enablerepo=remi install httpd php php-common
# yum — enablerepo=remi install php-pear php-pdo php-mysql php-gd php-mbstring php-mcrypt php-xml php-dom
Enable & Restart Services
# chkconfig -–add httpd
# chkconfig –-add mysqld
# service httpd start
# service mysqld start
Secure MySQL
# mysql_secure_installation
Testing
Once you have completed these steps, test you are running PHP 5.3 by executing:
# php -v
From the command line.
Thanks it…
Thanks for the help, but I get a lot of errors, e.g.:
file /usr/bin/mysqlaccess from install of mysql-5.5.14-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
It seems that there are some conflicts. I would appreciated any suggestions as I would love to upgrade my WordPress.
This issue is caused by RedHat’s handling if mixed x86 / 64 bit packages. If you run:
# rpm -qa | grep mysql
You will likely see two packages installed. The best solution is to edit /etc/yum.conf and add an exclusion:
exclude=*.i386 *.i586 *.i686
Then re-try the upgrade.
It seems that I had mysql.i386 istalled, but had the 64 bit version of mysql and mysql-server. I uninstalled mysql.i386 and ran the updates. It looks like things worked.
Thank you so much.
The exclude statement could be simpler…
exclude=*.i*86
HTH,
Bud
Thank you – great input. I’ve modified the article.
help… Missing Dependency: libltdl.so.3 is needed by package php-mcrypt-5.3.8-5.el5.remi.1.i386 (remi)