Customizing PHP

To customize PHP, you need to:

Installing the PHP Development add-on

The first step, for ServerXchange customers, is to install the PHP Development add-on onto the WEBppliance server. This service contains the development packages needed to rebuild PHP on WEBppliance.

To install the PHP Development add-on:

  1. Connect to the Server & Application Manager.

  2. Click Servers on the left navigation bar.

  3. Locate the server on which you want to install and click on the host name of the server.

  4. Click the Applications tab.

  5. In the Applications submenu, click Install.

  6. Locate PHP Development Addon and select the check box in the Select column.

  7. Click Next.

  8. Click Next again.

  9. Click Finish.

PHP is installed on your WEBppliance server.

Obtaining the PHP source RPM

In order to rebuild PHP, you must obtain the PHP source RPM. The PHP source RPM must be downloaded from Ensim’s FTP site, ftp://ftp.ensim.com.

To download the PHP source RPM:

  1. Connect to Ensim’s FTP site, ftp://ftp.ensim.com.

  2. Download the PHP source RPM, php-4.2.2-2ensim<x>.src.rpm.
    Where <x> represents the latest PHP release by Ensim.

Installing the PHP source RPM on the WEBppliance server

To install the PHP source RPM:

  1. Connect to your WEBppliance server.

telnet <myserver_name>

or

ssh <username@myserver_name>

  1. Install the PHP source RPMs on to your WEBppliance server using the following command:

rpm -ivh --define '_topdir <dir_name>' php-4.2.2-2ensim<x>.src.rpm  

where:

<dir_name> is the directory where you want to install the source files

<x> represents the latest PHP release by Ensim

Modifying the PHP source file

You need to modify the PHP source file, php.spec, to customize the capabilities of PHP.

To modify the PHP source file:

  1. Change your working directory to the directory where you installed the PHP source files.

cd <dir_name>

where <dir_name> is the directory where you have installed the PHP source files.

  1. Create the following directories, BUILD, RPMS/i386, SRPMS, using the following command.

mkdir -p BUILD RPMS/i386 SRPMS

  1. Modify the php.spec file that contains the configurable options for PHP.

vi <topdir>/SPECS/php.spec

  1. Save your changes to the file and exit.

:wq

Rebuilding the PHP source RPM

To rebuild the PHP source RPM:

  1. Build the PHP source RPM using the following command.

rpmbuild --define '_topdir <dir_name>' -ba <dir_name>/SPECS/php.spec

If the process exits with "state 0", it indicates that the rebuild is successful.

The rebuilt RPMs will be available in the location, /<dir_name>/RPMS/i386.

Installing the rebuilt PHP RPMs on the WEBppliance server

After rebuilding the PHP source RPM, you must install the rebuilt PHP RPMs on the WEBppliance server.

  1. Log onto your WEBppliance server as a root user.

su -

  1. Browse to the folder, /<dir_name>/RPMS/i386, that contains the recompiled RPMs.

  2. Install the RPMs using the following command.

rpm -Uvh *.rpm

  1. Restart the Web server.

  2. Note: You need to restart the Web server to enable the customized capabilities.

Related Topics