Upgrading PHP to new version
im on RHEL 6 with PHP 5.3.3 integrated into apache and mysql. What are the general steps for upgrading php and insuring that apache uses the new version?
Should i de-install php 5.3.3 and then install the new version? Keep in mind im trying to not break apache, wordpress, or mysql. I am not using phpmyadmin though.
The php related items I have are below
php.x86_64 5.3.3-46.el6_6 @rhel-6-server-rpms
php-cli.x86_64 5.3.3-46.el6_6 @rhel-6-server-rpms
php-common.x86_64 5.3.3-46.el6_6 @rhel-6-server-rpms
php-gd.x86_64 5.3.3-46.el6_6 @rhel-6-server-rpms
php-mcrypt.x86_64 5.3.3-4.el6 @epel
php-mysql.x86_64 5.3.3-46.el6_6 @rhel-6-server-rpms
php-pdo.x86_64 5.3.3-46.el6_6 @rhel-6-server-rpms
php-pear.noarch 1:1.9.4-4.el6 @rhel-6-server-rpms
php-pgsql.x86_64 5.3.3-46.el6_6 @rhel-6-server-rpms
php-xml.x86_64 5.3.3-46.el6_6 @rhel-6-server-rpms
2.6.32-573.12.1.el6.x86_64 #1 SMP Mon Nov 23 12:55:32 EST 2015 x86_64 x86_64 x86_64 GNU/Linux
Responses
Douglas,
What version are you expecting to upgrade to?
RHEL 6 ships with php 5.3.3.
If you want the latest available in RHEL6 (5.3.3-47), the process is to upgrade the RPMs inline using yum. If you want to use the RHSCL (Red Hat Software Collections) version (php 5.4, 5.5 or 5.6), you would need to add the RHSCL repository and modify your configuration to use the alternative php binaries.
If you plan to use third party RPM / build from source, the process will be different again.
In short, if you want to use a newer supported PHP in RHEL6, you can use the php54 packages from RHSCL with RHEL6's standard httpd; however, they're only going to be supported until October so I would instead recommend installing httpd24 & rh-php56-php. (Note that the php55 and rh-php56 collections are built for httpd24 and won't work with standard httpd.)
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
