PHP 5.4 on RHEL-6 using RHSCL Posted on August 1, 2013 by Remi Collet 5 Votes Official announcement : Red Hat Software Collections 1.0 Beta Now Available More information on Software Collections Software Collections Guide Stability addicts can keep quiet, PHP 5.3.3 is still the standard version provided with RHEL-6. We ll soon have an official and supported way to install PHP version 5.4, beside the system version, without any effect on installed components. The announcement tells us the life cycle will be 3 years. Warning: it s a beta version, published for evaluation purposes. Installation Activation of the distribution channel (requires a valid subscription) from the RHN web interface or from command line: # rhn-channel --add --channel=rhel-x86_64-server-6-rhscl-1-beta Installation of the meta-package and default components: # yum install php54... Package Arch Version Repository Installing: php54 x86_64 1-7.el6 rhel-x86_64-server-6-rhscl-1-be Installing for dependencies: php54-php-cli x86_64 5.4.14-3.el6 rhel-x86_64-server-6-rhscl-1-be php54-php-common x86_64 5.4.14-3.el6 rhel-x86_64-server-6-rhscl-1-be php54-php-pear noarch 1:1.9.4-7.el6 rhel-x86_64-server-6-rhscl-1-be php54-php-process x86_64 5.4.14-3.el6 rhel-x86_64-server-6-rhscl-1-be php54-php-xml x86_64 5.4.14-3.el6 rhel-x86_64-server-6-rhscl-1-be php54-runtime x86_64 1-7.el6 rhel-x86_64-server-6-rhscl-1-be Transaction Summary Install 7 Package(s) Total download size: 4.7 M Installed size: 0 Is this ok [y/n]: y That s all Utilisation Default version still 5.3.3 # php -v PHP 5.3.3 (cli) (built: Nov 29 2012 04:12:23) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies 1 de 5 04/06/2015 20:18
You need to explicitly ask to use the SCL version, standard (SCL) way: # scl enable php54 "php -v" You can also use (for this collection, not supported for others): # /opt/rh/php54/root/usr/bin/php -v You can also permanently activate the collection: # source /opt/rh/php54/enable # php -v Use from Apache Various ways exist (CGI, FastCGI, ) we ll only see the mod_php case # yum install php54-php Warning : apache can t load 2 php5 modules, so if the standard module is already present, on apache startup, you will get the error message: [Sun Jun 16 16:51:01 2013] [warn] module php5_module is already loaded, skipping You need to uninstall (or disable) the standard module, and then apache will use the PHP 5.4 from the collection. PEAR extensions See : PHP Extension and Application Repository The collection has a dedicated pear installation tree (/opt/rh/php54/root/usr/share/pear), which means that pear extensions are not shared between system and collection. # pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.7 stable Console_Getopt 1.2.3 stable PEAR 1.9.4 stable Structures_Graph 1.0.4 stable XML_RPC 1.5.4 stable XML_Util 1.2.1 stable # scl enable php54 "pear list" Installed packages, channel pear.php.net: ========================================= Package Archive_Tar Version State 1.3.11 stable Console_Getopt 1.3.1 stable PEAR 1.9.4 stable Structures_Graph 1.0.4 stable XML_Util 1.2.1 stable The pear command can be used to install more extensions in the collection. PECL extensions See : PECL extension repository Currently available in the collection: memcache extension: php54-php-pecl-memcache. 2 de 5 04/06/2015 20:18
3 de 5 04/06/2015 20:18 APC extension, provided for user data cache only (opcode cache is disabled as not considered stable for PHP 5.4): php54-php-pecl-apc and php54-apc-panel. The pecl command can be used in the collection to manually install (build) more extensions. Those extensions will be available in the collection without altering the default system PHP. Some experimental packages of commonly needed extensions are available in my personal testing repository. (interbase, mssql, mcrypt, apcu, igbinary, imagick, mongo, radius, sphinx, xhprof, xdebug, zendopcache ). Conclusion I think this is a very important new feature which should help the adoption of more recent PHP versions in enterprise environment. RHEL clone users can also try the packages available on the community project site : Software Collections For more information about Red Hat Software Collections or Red Hat Developer Toolset, visit developer.redhat.com/rhel. SHARE THIS: Be the first to like this. This entry was posted in Software Collections and tagged php, RHEL, software collections by Remi Collet. Bookmark the permalink [http://developerblog.redhat.com/2013/08/01/php-5-4-on-rhel-6-using-rhscl/]. 18 THOUGHTS ON PHP 5.4 ON RHEL-6 USING RHSCL Jeff Bilbro on August 1, 2013 at 12:46 pm said: Will this ever leave beta status and be supported for production use? on August 2, 2013 at 11:13 am said: Red Hat is working to solidify the new capabilities that Red Hat Software Collections brings to Red Hat Enterprise Linux and we are really excited to release a production version if and when we believe it is ready for enterprise deployments. Joshua Witt on October 17, 2014 at 5:02 pm said: Is it ready now? Mike Guerette (Red Hat) on October 18, 2014 at 9:29 am said: Yes. Both PHP 5.4 and 5.5 Software Collections are GA. See http://developerblog.redhat.com/2014/06/04/red-hat-software-collections-rhscl-1-1-now-ga/
4 de 5 04/06/2015 20:18 Dag Wieers on August 1, 2013 at 4:23 pm said: It s strange that APC is included and not zendopcache, since the latter one is supported since PHP 5.2 and now officially included in PHP 5.5 (as shipping with RHEL 5.10) whereas APC was never considered stable on PHP 5.4 (in so much that Red Hat is shipping a version from subversion rather than a proper released version). We have been using zendopcache for some time with PHP 5.4 with great result and are considering to move to RHSCL 1.0, but the lack of zendopcache and xhprofile is a real concern. André R. (@andrerom) on August 9, 2013 at 3:57 am said: zendopcache would probably be the better choiche here, but until this is added the collection already offers some benefits over the defaults that is highly needed. PHP 5.3.3 is getting more and more difficult to support with it s edge case issues not found in newer versions. André R. (@andrerom) on August 9, 2013 at 3:59 am said: I overlooked the opcode cache is disabled as not considered stable for PHP 5.4 part. If this is the case, this is not really usable. dagwieers on August 14, 2013 at 3:42 pm said: That statement is disputed Roland on August 9, 2013 at 11:28 am said: Same here, we would really need Zend OPcache as APC is not considered stable. wjaramillo on September 19, 2013 at 11:21 am said: Enabled PHP/php-cgi version should be controlled by update-alternatives command. on September 20, 2013 at 11:08 am said: Software Collections enables the php version to be run per app. Update-alternatives is trying to solve a different problem, changing the whole machine to use a different version of something (in this case, php). The one is not exclusive of the other.
5 de 5 04/06/2015 20:18 Pingback: Our Top 12 Blog Articles of 2013 Red Hat Developer Blog Pingback: Apache httpd 2.4 on Red Hat Enterprise Linux 6 Red Hat Developer Blog Pingback: Upgrading PHP 5.3.3 to 5.4 CentOS 6.4 (Transaction Check Error) zhj on April 25, 2014 at 9:36 am said: Could you please explain Use from Apache more. How do I enable this from Apache? What is the standard module? on May 1, 2014 at 2:37 pm said: We cover Apache + PHP more in some other articles. One really useful one is. You can also look at the apache tag for more articles about Apache httpd. Pingback: Installing php 5.4 or 5.5 on CentOS 6.x / RHEL 6.x / SL 6.x «Sig-I/O Automatisering weiterer on September 13, 2014 at 2:25 am said: Opcache is included, it can be installed with php54-php-pecl-zendopcache.x86_64 Actually the article seems to be wrong, its APC which is not stable with PHP 5.4, opcache is shipped by default with PHP 5.5 already (while not enabled). SCL is a nice move by Red Hat, in particular because most vendors are dropping support for 5.3* and require as minimum PHP 5.4* and this will cause a major pain for users still on RHEL6. While the move to support a newer version is nice, the extra packages are not, things like mcrypt and other required and used popular modules should be available as default if someone wants a working PHP system. It seems this project and idea is half baked, unless Red Hat puts someone working on this or they plan to update the official PHP package allot of users using RHEL 6 and clones are going to start suffering with PHP apps in a very short future even popular open source applications are not supporting PHP 5.3.3 anymore.