PHP RPM Package Installation

These packages are for Enterprise Linux 4 update 6 and Enterprise Linux 5 update 1 on x86.

The packages are provided for installation convenience and testing purposes. They are not supported. The PHP distribution is version 5.2.5, with the addition of an OCI8 extension patch for bug 42496.

The PHP packages are listed in tables 1.1, 1.2 and 1.3.

Table 1.1 Packages for EL 4.6
php-5.2.5-1.i386.rpmPHP module for the Apache HTTP Server
php-bcmath-5.2.5-1.i386.rpmPHP bcmath extension for arbitrary precision mathematics
php-cli-5.2.5-1.i386.rpmCommand-line and CGI interfaces for PHP
php-common-5.2.5-1.i386.rpmCommon files for PHP packages
php-dba-5.2.5-1.i386.rpmPHP dba extension for Berkeley style database access
php-devel-5.2.5-1.i386.rpmFiles for building PHP extensions
php-gd-5.2.5-1.i386.rpmPHP gd extension for graphics
php-imap-5.2.5-1.i386.rpmPHP IMAP message protocol extension
php-ldap-5.2.5-1.i386.rpmPHP LDAP support for the Apache HTTP Server
php-mbstring-5.2.5-1.i386.rpmPHP mbstring extension for multi-byte string functionality
php-mysql-5.2.5-1.i386.rpmPHP mysql, mysqli and PDO_MYSQL extensions for the MySQL database
php-ncurses-5.2.5-1.i386.rpmPHP ncurses terminal output interface
php-oci8-5.2.5-1.i386.rpmPHP oci8 and PDO_OCI extensions for the Oracle Database
php-odbc-5.2.5-1.i386.rpmPHP odbc extension
php-pdo-5.2.5-1.i386.rpmPHP "PHP Data Object" (PDO) data access abstraction
php-pgsql-5.2.5-1.i386.rpmPHP pgsql and PDO_PGSQL extensions for the PostgreSQL database
php-snmp-5.2.5-1.i386.rpmPHP SNMP extension
php-soap-5.2.5-1.i386.rpmPHP SOAP extension
php-xml-5.2.5-1.i386.rpmPHP xmlwriter, xmlreader, xsl and dom extensions
php-xmlrpc-5.2.5-1.i386.rpmPHP XML-RPC extension

Table 1.2 Packages for EL 5.1
php-5.2.5-1.el5.i386.rpmPHP module for the Apache HTTP Server
php-bcmath-5.2.5-1.el5.i386.rpmPHP bcmath extension for arbitrary precision mathematics
php-cli-5.2.5-1.el5.i386.rpmCommand-line and CGI interfaces for PHP
php-common-5.2.5-1.el5.i386.rpmCommon files for PHP packages
php-dba-5.2.5-1.el5.i386.rpmPHP dba extension for Berkeley style database access
php-devel-5.2.5-1.el5.i386.rpmFiles for building PHP extensions
php-gd-5.2.5-1.el5.i386.rpmPHP gd extension for graphics
php-imap-5.2.5-1.el5.i386.rpmPHP IMAP message protocol extension
php-ldap-5.2.5-1.el5.i386.rpmPHP LDAP support for the Apache HTTP Server
php-mbstring-5.2.5-1.el5.i386.rpmPHP mbstring extension for multi-byte string functionality
php-mysql-5.2.5-1.el5.i386.rpmPHP mysql, mysqli and PDO_MYSQL extensions for the MySQL database
php-ncurses-5.2.5-1.el5.i386.rpmPHP ncurses terminal output interface
php-oci8-5.2.5-1.el5.i386.rpmPHP oci8 and PDO_OCI extensions for the Oracle Database
php-odbc-5.2.5-1.el5.i386.rpmPHP odbc extension
php-pdo-5.2.5-1.el5.i386.rpmPHP "PHP Data Object" (PDO) data access abstraction
php-pgsql-5.2.5-1.el5.i386.rpmPHP pgsql and PDO_PGSQL extensions for the PostgreSQL database
php-snmp-5.2.5-1.el5.i386.rpmPHP SNMP extension
php-soap-5.2.5-1.el5.i386.rpmPHP SOAP extension
php-xml-5.2.5-1.el5.i386.rpmPHP xmlwriter, xmlreader, xsl and dom extensions
php-xmlrpc-5.2.5-1.el5.i386.rpmPHP XML-RPC extension

Table 1.3 Source Package
php-5.2.5-1.src.rpmSource RPM for PHP packages

Installing the base PHP RPM packages

To install PHP for command-line use and as an Apache module:

  1. Log into a command shell as the root user.

  2. Backup and deinstall any existing PHP packages. Use

    rpm -qa | grep php
    to show the PHP packages currently installed. Use
    rpm -e <package_name>
    to remove them.

  3. Install the new PHP RPMs with the command:

    rpm -ivh php-common-5.2.5-1.i386.rpm php-cli-5.2.5-1.i386.rpm php-5.2.5-1.i386.rpm
  4. If any dependencies are unsatisfied, install the required packages and retry the above command.

  5. To verify the PHP RPMs have been installed, run

    rpm -qa |grep php

    You should see:

    php-common-5.2.5-1
    php-5.2.5-1
    php-cli-5.2.5-1
    
  6. Restart Apache:

    /etc/init.d/httpd restart

The PHP configuration file is located at /etc/php.ini.

An empty directory /etc/php.d is created. It will contain PHP per-extension ".ini" configuration files of any extensions installed in the future.

The Apache configuration file is in /etc/httpd/conf.d/php.conf.

Installing Oracle extensions

  1. The php-oci8 package depends on version 10.2.0.3 of Oracle's free Instant Client Basic package. Download oracle-instantclient-basic-10.2.0.3-1.i386.rpm and install it with:

    rpm -ivh oracle-instantclient-basic-10.2.0.3-1.i386.rpm
  2. Set the environment to use the Instant Client libraries.

  3. Install PHP's Oracle OCI8 and PDO_OCI extensions with:

    rpm -ivh php-pdo-5.2.5-1.i386.rpm php-oci8-5.2.5-1.i386.rpm 
  4. Restart Apache:

    /etc/init.d/httpd restart
  5. Verify that oci8 is installed by loading this script in a browser:

    <?php
      phpinfo();
    ?>
    

    The output should include sections on OCI8 and PDO_OCI

  6. Optionally configure OCI8 tuning parameters in the section marked [OCI8] in /etc/php.ini

Using the Oracle Extensions

The Oracle Technology Network has a PHP Developer Center with many resources. In particular refer to the free Underground PHP and Oracle Manual