Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

PHP 5.4 on RHEL-6 using RHSCL

August 1, 2013
Remi Collet
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

    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                                          Size
    ======================================================================================================================================================
    Installing:
     php54                              x86_64                  1-7.el6                          rhel-x86_64-server-6-rhscl-1-beta                  3.3 k
    Installing for dependencies:
     php54-php-cli                      x86_64                  5.4.14-3.el6                     rhel-x86_64-server-6-rhscl-1-beta                  2.6 M
     php54-php-common                   x86_64                  5.4.14-3.el6                     rhel-x86_64-server-6-rhscl-1-beta                  566 k
     php54-php-pear                     noarch                  1:1.9.4-7.el6                    rhel-x86_64-server-6-rhscl-1-beta                  370 k
     php54-php-process                  x86_64                  5.4.14-3.el6                     rhel-x86_64-server-6-rhscl-1-beta                   45 k
     php54-php-xml                      x86_64                  5.4.14-3.el6                     rhel-x86_64-server-6-rhscl-1-beta                  109 k
     php54-runtime                      x86_64                  1-7.el6                          rhel-x86_64-server-6-rhscl-1-beta                  1.0 M
    
    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

    You need to explicitly ask to use the SCL version, standard (SCL) way:

    # scl enable php54 "php -v"
    PHP 5.4.14 (cli) (built: May 23 2013 07:42:19)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

    You can also use (for this collection, not supported for others):

    # /opt/rh/php54/root/usr/bin/php -v
    PHP 5.4.14 (cli) (built: May 23 2013 07:42:19)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

    You can also permanently activate the collection:

    # source /opt/rh/php54/enable
    # php -v
    PHP 5.4.14 (cli) (built: May 23 2013 07:42:19)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

    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          Version State
    Archive_Tar      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.
    • 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

    Last updated: February 22, 2024

    Recent Posts

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    • Best Practice Configuration and Tuning for Linux and Windows VMs

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.