Last modified: 27 Dec 2007
WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the
official Parallels site.
H-Sphere 2.5 and up introduces separate packages for PHP. PHP 4 and PHP 5 packages include almost all commonly used extensions.
So, before you start re-compiling PHP, make sure that an extension you need to add is indeed absent.
See the list of modules included in PHP 4 and PHP 5.
Before the compilation, check that the following libraries are installed:
Other required libraries are listed in the documentation to respective modules.
Please also take into account that PHP 4 and PHP 5 have different module structures.
For example, the domxml module in PHP 4 is absent in PHP 5.
Adding New Extensions
PHP packages are built from modules. To include a new module, use phpize in the following way:
# tar zxf your_module.tgz
# cd your_module
# ./configure --with-php-config=/hsphere/shared/<PHPVERSION>/bin/php-config
# make install
<PHPVERSION> is php4 or php5, depending on PHP version.
To find out where a new extension is compiled to and where all other PHP extensions are located, run:
# /hsphere/shared/<PHPVERSION>/bin/php-config --extension-dir
Adding PEAR Modules
To install PEAR modules, run:
# /hsphere/shared/<PHPVERSION>/bin/pear install your_module
Read the PEAR Command line installer documentation
Adding PECL Modules
PECL modules can be installed either by phpize or by pear. See
Installation of PECL extensions in PHP Guide.
Enabling/Disabling Built-In PHP Modules
Modules that are installed with PHP packages are enabled by default. To disable (or enable) a module:
- Go to the directory where respective .ini file for a module is located:
# cd /hsphere/local/config/httpd/<PHPVERSION>/php.d/
Here, <PHPVERSION> is php4 or php5.
- Open the <module_name>.ini file for edit. See the list of PHP modules.
- Comment the line extension=<module_name>.so to disable the module:
Uncomment this line to enable the module.
- Restart Apache on the Web server to apply changes.