martes, 5 de junio de 2007

HOWTO PHP 5.2.1 RHEL 5

HOWTO PHP 5.2.1 With Module PHP-Oracle RHEL 5

Author Cristhian Nunez
Date 2007-06-05
Document description: Compiling PHP 5.2.1 for Support Oracle module



Overview

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

The main implementation is produced by The PHP Group and released under the PHP License. It is considered to be free software by the Free Software Foundation[2]. This implementation serves to define a de facto standard for PHP, as there is no formal specification.

PHP generally runs on a web server, taking PHP code as its input and creating Web pages as output, however it can also be used for command-line scripting and client-side GUI applications. PHP can be deployed on most web servers and on almost every operating system and platform free of charge. The PHP Group also provides the complete source code for users to build, customize and extend for their own use.

Originally designed to create dynamic web pages, PHP's principal focus is server-side scripting. While running the PHP parser with a web server and web browser, the PHP model can be compared to other server-side scripting languages such as Microsoft's ASP.NET system, Sun Microsystems' JavaServer Pages, mod_perl and the Ruby on Rails framework, as they all provide dynamic content to the client from a web server. To more directly compete with the "framework" approach taken by these systems, Zend is working on the Zend Framework - an emerging (as of June 2006) set of PHP building blocks and best practices; other PHP frameworks along the same lines include CakePHP, PRADO and Symfony.

PHP 5 Features


Support for object-oriented programming
The PHP Data Objects extension, which defines a lightweight and consistent interface for accessing databases
Performance enhancements
Better support for MySQL
Embedded support for SQLite
Integrated SOAP support
Data iterators
Error handling via exceptions

Implementation

Download and unpack php-5.2.1.tar.bz2
Apply the following commands:
Note: Before compile PHP, ensure you have the following packages installed:

  • apr-devel-1.2.7-11.i386.rpm # httpd-devel dependencies
  • apr-util-devel-1.2.7-6.i386.rpm #httpd-devel dependencies
  • httpd-devel-2.2.3-6.el5.i386.rpm #For the apxs command
  • mysql-devel-5.0.22-2.1.i386.rpm # Msqli support
  • Compile libmcrypt-2.5.8.tar.gz for support mcrypt

Also, Ensure have installed Oracle and declared the variable $ORACLE_HOME

./configure --with-oci8=$ORACLE_HOME --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc/httpd/conf --enable-sigchild --with-mysql=/usr/include/mysql --enable-soap --with-mysqli --with-zlib --enable-zip --with-ldap-sasl --with-openssl --with-ldap –with-mcrypt

make

make install

Ensure that Apache does not load the default module php installed. Comment the following line y /etc/httpd/conf/httpd.conf

#LoadModule php5_module /usr/lib/httpd/modules/libphp5.so

restart Apache. /etc/init.d/httpd restart

Test your configuration. Create a index.php file with the following contents:


Go to the browser and load the index.php file and check the configuration.