Parallels H-Sphere Documentation System Administrator Guide

 

Adding PHP Extensions

(version 2.5 and up)
 
 

Related Docs:   PHP Compilation (2.4.x) H-Sphere PHP Packages PHP Module List PHP Safe Mode Configuration Software Recompilation Request

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.

 

Compilation Requirements

Before the compilation, check that the following libraries are installed:

  • autoconf
  • automake
  • libtool
  • zlib-devel
  • mysql-devel
  • postgresql-devel

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
# /hsphere/shared/php4/bin/phpize
# ./configure --with-php-config=/hsphere/shared/<PHPVERSION>/bin/php-config
# make
# 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

Aslo you can use additional options in configuration string, for example:

./configure --with-php-config=/hsphere/shared/php4/bin/php-config --with-mssql=/usr/local/freetds --enable-msdblib

 

Adding PEAR Modules

To install PEAR modules, run:

# /hsphere/shared/<PHPVERSION>/bin/pear install your_module

Read the PEAR Command line installer documentation for details.

 

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:

  1. 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.
  2. Open the <module_name>.ini file for edit. See the list of PHP modules.
  3. Comment the line extension=<module_name>.so to disable the module:

    ; extension=<module_name>.so

    Uncomment this line to enable the module.
  4. Restart Apache on the Web server to apply changes.

Related Docs:   PHP Compilation (2.4.x) H-Sphere PHP Packages PHP Module List PHP Safe Mode Configuration Software Recompilation Request



© Copyright 2017. Parallels Holdings. All rights reserved.