


Red Hat Enterprise Linux Server release 6.8の標準repo(rhel-6-server-rpms)ではphp 5.3系になります。
今回は検証でphp 5.4にアップグレードしてみました。
サブスクリプションは無料の開発サブスクリプションになります。
- enable rhel-server-rhscl-6-rpms
- Install php 5.4
- php 5.4の利用
rhel-server-rhscl-6-rpmsを有効にすることでphp 5.4, php 5.5, php 5.6が利用できるようになります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# yum-config-manager --enable rhel-server-rhscl-6-rpms # yum search php Loaded plugins: product-id, search-disabled-repos, security, subscription-manager rhel-6-server-eus-rpms | 3.5 kB 00:00 rhel-6-server-optional-rpms | 3.3 kB 00:00 rhel-6-server-rpms | 3.5 kB 00:00 rhel-ha-for-rhel-6-server-eus-rpms | 3.4 kB 00:00 rhel-ha-for-rhel-6-server-rpms | 3.4 kB 00:00 rhel-hpn-for-rhel-6-server-rpms | 3.4 kB 00:00 rhel-lb-for-rhel-6-server-eus-rpms | 3.4 kB 00:00 rhel-lb-for-rhel-6-server-rpms | 3.4 kB 00:00 rhel-rs-for-rhel-6-server-eus-rpms | 3.4 kB 00:00 rhel-rs-for-rhel-6-server-rpms | 3.4 kB 00:00 rhel-scalefs-for-rhel-6-server-rpms | 3.4 kB 00:00 rhel-server-dts-6-rpms | 4.0 kB 00:00 rhel-server-dts2-6-rpms | 3.2 kB 00:00 rhel-server-rhscl-6-rpms | 3.5 kB 00:00 rhel-server-rhscl-6-rpms/primary_db | 3.0 MB 00:01 rhel-sfs-for-rhel-6-server-eus-rpms | 3.4 kB 00:00 =========================================== N/S Matched: php ============================================ cups-php.x86_64 : Common Unix Printing System - php module graphviz-php.x86_64 : PHP extension for graphviz php.x86_64 : PHP scripting language for creating dynamic web sites php-bcmath.x86_64 : A module for PHP applications for using the bcmath library php-cli.x86_64 : Command-line interface for PHP php-common.x86_64 : Common files for PHP php-dba.x86_64 : A database abstraction layer module for PHP applications php-devel.x86_64 : Files needed for building PHP extensions php-embedded.x86_64 : PHP library for embedding in applications php-fpm.x86_64 : PHP FastCGI Process Manager php-gd.x86_64 : A module for PHP applications for using the gd graphics library php-imap.x86_64 : A module for PHP applications that use IMAP php-intl.x86_64 : Internationalization extension for PHP applications php-ldap.x86_64 : A module for PHP applications that use LDAP php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php-mysql.x86_64 : A module for PHP applications that use MySQL databases php-odbc.x86_64 : A module for PHP applications that use ODBC databases php-pdo.x86_64 : A database access abstraction module for PHP applications php-pear.noarch : PHP Extension and Application Repository framework php-pecl-apc.x86_64 : APC caches and optimizes PHP intermediate code php-pgsql.x86_64 : A PostgreSQL database module for PHP php-process.x86_64 : Modules for PHP script using system process interfaces php-pspell.x86_64 : A module for PHP applications for using pspell interfaces php-recode.x86_64 : A module for PHP applications for using the recode library php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php-soap.x86_64 : A module for PHP applications that use the SOAP protocol php-tidy.x86_64 : Standard PHP module provides tidy library support php-xml.x86_64 : A module for PHP applications which use XML php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol php-zts.x86_64 : Thread-safe PHP interpreter for use with the Apache HTTP Server php54.x86_64 : Package that installs php54 php54-php.x86_64 : PHP scripting language for creating dynamic web sites php54-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library php54-php-cli.x86_64 : Command-line interface for PHP php54-php-common.x86_64 : Common files for PHP php54-php-dba.x86_64 : A database abstraction layer module for PHP applications php54-php-devel.x86_64 : Files needed for building PHP extensions php54-php-enchant.x86_64 : Enchant spelling extension for PHP applications php54-php-fpm.x86_64 : PHP FastCGI Process Manager php54-php-gd.x86_64 : A module for PHP applications for using the gd graphics library php54-php-imap.x86_64 : A module for PHP applications that use IMAP php54-php-intl.x86_64 : Internationalization extension for PHP applications php54-php-ldap.x86_64 : A module for PHP applications that use LDAP php54-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php54-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php54-php-odbc.x86_64 : A module for PHP applications that use ODBC databases php54-php-pdo.x86_64 : A database access abstraction module for PHP applications php54-php-pear.noarch : PHP Extension and Application Repository framework php54-php-pecl-apc.x86_64 : APC caches and optimizes PHP intermediate code php54-php-pgsql.x86_64 : A PostgreSQL database module for PHP php54-php-process.x86_64 : Modules for PHP script using system process interfaces php54-php-pspell.x86_64 : A module for PHP applications for using pspell interfaces php54-php-recode.x86_64 : A module for PHP applications for using the recode library php54-php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php54-php-soap.x86_64 : A module for PHP applications that use the SOAP protocol php54-php-tidy.x86_64 : Standard PHP module provides tidy library support php54-php-xml.x86_64 : A module for PHP applications which use XML php54-php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol php54-runtime.x86_64 : Package that handles php54 Software Collection. php54-scldevel.x86_64 : Package shipping development files for php54 php55.x86_64 : Package that installs PHP 5.5 php55-php.x86_64 : PHP scripting language for creating dynamic web sites php55-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library php55-php-cli.x86_64 : Command-line interface for PHP php55-php-common.x86_64 : Common files for PHP php55-php-dba.x86_64 : A database abstraction layer module for PHP applications php55-php-devel.x86_64 : Files needed for building PHP extensions php55-php-enchant.x86_64 : Enchant spelling extension for PHP applications php55-php-fpm.x86_64 : PHP FastCGI Process Manager php55-php-gd.x86_64 : A module for PHP applications for using the gd graphics library php55-php-gmp.x86_64 : A module for PHP applications for using the GNU MP library php55-php-imap.x86_64 : A module for PHP applications that use IMAP php55-php-intl.x86_64 : Internationalization extension for PHP applications php55-php-ldap.x86_64 : A module for PHP applications that use LDAP php55-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php55-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php55-php-odbc.x86_64 : A module for PHP applications that use ODBC databases php55-php-pdo.x86_64 : A database access abstraction module for PHP applications php55-php-pear.noarch : PHP Extension and Application Repository framework php55-php-pecl-mongo.x86_64 : PHP MongoDB database driver php55-php-pgsql.x86_64 : A PostgreSQL database module for PHP php55-php-process.x86_64 : Modules for PHP script using system process interfaces php55-php-pspell.x86_64 : A module for PHP applications for using pspell interfaces php55-php-recode.x86_64 : A module for PHP applications for using the recode library php55-php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php55-php-soap.x86_64 : A module for PHP applications that use the SOAP protocol php55-php-tidy.x86_64 : Standard PHP module provides tidy library support php55-php-xml.x86_64 : A module for PHP applications which use XML php55-php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol php55-runtime.x86_64 : Package that handles php55 Software Collection. php55-scldevel.x86_64 : Package shipping development files for php55 rh-php56.x86_64 : Package that installs PHP 5.6 rh-php56-php.x86_64 : PHP scripting language for creating dynamic web sites rh-php56-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library rh-php56-php-cli.x86_64 : Command-line interface for PHP rh-php56-php-common.x86_64 : Common files for PHP rh-php56-php-dba.x86_64 : A database abstraction layer module for PHP applications rh-php56-php-dbg.x86_64 : The interactive PHP debugger rh-php56-php-devel.x86_64 : Files needed for building PHP extensions rh-php56-php-embedded.x86_64 : PHP library for embedding in applications rh-php56-php-enchant.x86_64 : Enchant spelling extension for PHP applications rh-php56-php-fpm.x86_64 : PHP FastCGI Process Manager rh-php56-php-gd.x86_64 : A module for PHP applications for using the gd graphics library rh-php56-php-gmp.x86_64 : A module for PHP applications for using the GNU MP library rh-php56-php-imap.x86_64 : A module for PHP applications that use IMAP rh-php56-php-intl.x86_64 : Internationalization extension for PHP applications rh-php56-php-ldap.x86_64 : A module for PHP applications that use LDAP rh-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling rh-php56-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases rh-php56-php-odbc.x86_64 : A module for PHP applications that use ODBC databases rh-php56-php-pdo.x86_64 : A database access abstraction module for PHP applications rh-php56-php-pear.noarch : PHP Extension and Application Repository framework rh-php56-php-pecl-mongo.x86_64 : PHP MongoDB database driver rh-php56-php-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts rh-php56-php-pgsql.x86_64 : A PostgreSQL database module for PHP rh-php56-php-process.x86_64 : Modules for PHP script using system process interfaces rh-php56-php-pspell.x86_64 : A module for PHP applications for using pspell interfaces rh-php56-php-recode.x86_64 : A module for PHP applications for using the recode library rh-php56-php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices rh-php56-php-soap.x86_64 : A module for PHP applications that use the SOAP protocol rh-php56-php-tidy.x86_64 : Standard PHP module provides tidy library support rh-php56-php-xml.x86_64 : A module for PHP applications which use XML rh-php56-php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol rh-php56-runtime.x86_64 : Package that handles rh-php56 Software Collection. rh-php56-scldevel.x86_64 : Package shipping development files for rh-php56 rrdtool-php.x86_64 : PHP RRDtool bindings uuid-php.x86_64 : PHP support for Universally Unique Identifier library php-enchant.x86_64 : Human Language and Character Encoding Support php-pecl-apc-devel.i686 : APC developer files (header) php-pecl-apc-devel.x86_64 : APC developer files (header) php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon php54-apc-panel.noarch : APC control panel php54-php-pecl-apc-devel.x86_64 : APC developer files (header) php54-php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon php54-php-pecl-zendopcache.x86_64 : The Zend OPcache php55-php-opcache.x86_64 : The Zend OPcache php55-php-pecl-jsonc.x86_64 : Support for JSON serialization php55-php-pecl-jsonc-devel.x86_64 : JSON developer files (header) php55-php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon rh-php56-php-opcache.x86_64 : The Zend OPcache rh-php56-php-pecl-jsonc.x86_64 : Support for JSON serialization rh-php56-php-pecl-jsonc-devel.x86_64 : JSON developer files (header) rh-php56-php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon Name and summary matches only, use "search all" for everything. # yum info php54 Loaded plugins: product-id, search-disabled-repos, security, subscription-manager Available Packages Name : php54 Arch : x86_64 Version : 2.0 Release : 1.el6 Size : 3.9 k Repo : rhel-server-rhscl-6-rpms Summary : Package that installs PHP 5.4 License : GPLv2+ Description : This is the main package for php54 Software Collection, : that install PHP 5.4 language. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# yum install php54 (snip) Dependencies Resolved ========================================================================================================= Package Arch Version Repository Size ========================================================================================================= Installing: php54 x86_64 2.0-1.el6 rhel-server-rhscl-6-rpms 3.9 k Installing for dependencies: audit-libs-python x86_64 2.4.5-3.el6 rhel-6-server-rpms 63 k libselinux-python x86_64 2.0.94-7.el6 rhel-6-server-rpms 203 k libsemanage-python x86_64 2.0.43-5.1.el6 rhel-6-server-eus-rpms 81 k php54-php-cli x86_64 5.4.40-4.el6 rhel-server-rhscl-6-rpms 2.6 M php54-php-common x86_64 5.4.40-4.el6 rhel-server-rhscl-6-rpms 595 k php54-php-pear noarch 1:1.9.4-10.el6 rhel-server-rhscl-6-rpms 370 k php54-php-process x86_64 5.4.40-4.el6 rhel-server-rhscl-6-rpms 49 k php54-php-xml x86_64 5.4.40-4.el6 rhel-server-rhscl-6-rpms 114 k php54-runtime x86_64 2.0-1.el6 rhel-server-rhscl-6-rpms 1.0 M policycoreutils-python x86_64 2.0.83-29.el6 rhel-6-server-rpms 437 k setools-libs x86_64 3.3.7-4.el6 rhel-6-server-eus-rpms 400 k setools-libs-python x86_64 3.3.7-4.el6 rhel-6-server-eus-rpms 222 k Transaction Summary ========================================================================================================= Install 13 Package(s) Total download size: 6.1 M Installed size: 19 M Is this ok [y/N]: y (snip) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# rpm -qa | grep php | sort php-5.3.3-48.el6_8.x86_64 php-bcmath-5.3.3-48.el6_8.x86_64 php-cli-5.3.3-48.el6_8.x86_64 php-common-5.3.3-48.el6_8.x86_64 php-devel-5.3.3-48.el6_8.x86_64 php-gd-5.3.3-48.el6_8.x86_64 php-mbstring-5.3.3-48.el6_8.x86_64 php-mysql-5.3.3-48.el6_8.x86_64 php-pdo-5.3.3-48.el6_8.x86_64 php-pear-1.9.4-5.el6.noarch php-xml-5.3.3-48.el6_8.x86_64 php54-2.0-1.el6.x86_64 php54-php-cli-5.4.40-4.el6.x86_64 php54-php-common-5.4.40-4.el6.x86_64 php54-php-pear-1.9.4-10.el6.noarch php54-php-process-5.4.40-4.el6.x86_64 php54-php-xml-5.4.40-4.el6.x86_64 php54-runtime-2.0-1.el6.x86_64 # php -v PHP 5.3.3 (cli) (built: Jul 25 2016 05:47:24) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies # scl enable php54 "php -v" PHP 5.4.40 (cli) (built: Jul 22 2016 07:31:37) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies # source /opt/rh/php54/enable # php -v PHP 5.4.40 (cli) (built: Jul 22 2016 07:31:37) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies |
php 5.3とphp 5.4の切換えはPATHを変更しているだけです。
1 2 3 |
# cat /opt/rh/php54/enable export PATH=/opt/rh/php54/root/usr/bin:/opt/rh/php54/root/usr/sbin${PATH:+:${PATH}} export MANPATH=/opt/rh/php54/root/usr/share/man:${MANPATH} |
継続してphp 5.4を利用するようなら.bashrcに追加しておいた方が楽ですね
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# cat .bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # php 5.4 source /opt/rh/php54/enable |
Red Hat Software Collections (RHSCL)またはRed Hat Developer Toolset (DTS)が利用できるサブスクリプションは下記のサイトに書かれています。
How to use Red Hat Software Collections (RHSCL) or Red Hat Developer Toolset (DTS)?
https://access.redhat.com/solutions/472793