Customizing PHP
Note: Storefront customers do not have to install the PHP Development add-on separately. It is bundled with the WEBppliance software and automatically installed when WEBppliance is installed. Skip the section, "Installing the PHP Development add-on". The first step for storefront customers will be to obtain the source RPM from Ensim's FTP server.
To customize PHP, you need to:
Install the PHP Development add-on
Obtain the PHP source RPM
Install the PHP source RPM on the WEBppliance server
Modify the PHP source file
Rebuild PHP source RPM
Install the rebuilt PHP RPMs on the WEBppliance server
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:
Connect to the Server & Application Manager.
Click Servers on the left navigation bar.
Locate the server on which you want to install and click on the host name of the server.
Click the Applications tab.
In the Applications submenu, click Install.
Locate PHP Development Addon and select the check box in the Select column.
Click Next.
Click Next again.
Click Finish.
PHP is installed on your WEBppliance server.
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:
Connect to Ensim’s FTP site, ftp://ftp.ensim.com.
Download the PHP source RPM, php-4.2.2-2ensim<x>.src.rpm. Where <x> represents the latest PHP release by Ensim.
To install the PHP source RPM:
Connect to your WEBppliance server.
telnet <myserver_name>
or
ssh <username@myserver_name>
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
Important: You must specify a top directory if you are installing the RPM as a normal user, otherwise you will be unable to install the PHP source RPM. If you are installing the PHP source RPM as the root user, the topdir need not be defined.
You need to modify the PHP source file, php.spec, to customize the capabilities of PHP.
To modify the PHP source file:
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.
Create the following directories, BUILD, RPMS/i386, SRPMS, using the following command.
mkdir -p BUILD RPMS/i386 SRPMS
Important: Since the Linux environment is case sensitive, you must ensure that the directory names are capitalized.
Modify the php.spec file that contains the configurable options for PHP.
vi <topdir>/SPECS/php.spec
Important: Modifying certain options in the php.spec file could adversely affect the functioning of certain features in WEBppliance. For example, if you disable PhpMyAdmin or MySQL, your customers will be unable to manage their MySQL databases using the PhpMyAdmin MySQL interface. Similarly, if your disable IMAP, you cannot access your email messages using SquirrelMail. If you disable the gettext option, internationalization of PhpMyAdmin and SquirrelMail will not be supported.
Save your changes to the file and exit.
:wq
To rebuild the PHP source RPM:
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.
After rebuilding the PHP source RPM, you must install the rebuilt PHP RPMs on the WEBppliance server.
Log onto your WEBppliance server as a root user.
su -
Browse to the folder, /<dir_name>/RPMS/i386, that contains the recompiled RPMs.
Install the RPMs using the following command.
rpm -Uvh *.rpm
Restart the Web server.
Note: You need to restart the Web server to enable the customized capabilities.