Parallels H-Sphere Documentation System Administrator Guide


H-Sphere PHP

(H-Sphere 2.5 and up)

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.


PHP Packages

Starting with version 2.5, PHP is assembled into separate H-Sphere packages:


H-Sphere 3.1+

Package Description Comment
hsphere-php4-1x-4.4.7-x libphp4 for Apache 1.3.x Package updates
hsphere-php4-2x-4.4.7-x libphp4 for Apache 2.2.x
hsphere-php4-cgi-4.4.7-x CLI and CGI php4 binaries
hsphere-php4-pear-4.4.7-x PEAR for PHP4
hsphere-php4-plugins-4.4.7-x Set of plugins, their confs, which may work in pair with CLI, CGI or libphp4
hsphere-php5-1x-5.2.4-x libphp5 for Apache 1.3.x Package updates
hsphere-php5-2x-5.2.4-x libphp5 for Apache 2.2.x
hsphere-php5-cgi-5.2.4-x CLI and CGI php4 binaries
hsphere-php5-pear-5.2.4-x PEAR for PHP5
hsphere-php5-plugins-5.2.4-x set of plugins, their confs, which may work in pair with CLI, CGI or libphp5


H-Sphere 2.5 and 3.0

  • hsphere-php4-X.X-X, hsphere-php5-5.X.X-X - default php compilation:, php, pear, phpize, etc. and default extensions: bcmath, bz2, curl, domxml, fileinfo, ftp, gd, gettext, gmp, iconv, imap, mcal, mcrypt, mhash, mnogosearch, mysql, odbc, pgsql, sockets, sqlite, swf, zip, zlib
  • hsphere-php4-plugins-4.X.X-X, hsphere-php5-plugins-5.X.X-X - additional extensions: calendar, dba, dbase, dbx, exif, filepro, mime_magic, ncurses, overload, pcntl, pcre, pdf, posix, pspell, session, shmop, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlrpc, xslt, yp
X.X-X is the latest available package version.


Configuring PHP from the Interface


H-Sphere 3.1+

In H-Sphere 3.1+ administrators have more capacity in configuring PHP while users can choose between PHP 4 and 5. Please refer to the document on Apache in H-Sphere 3.1+ where this functionality is described.


H-Sphere 2.5 and 3.0

In H-Sphere 2.5 and 3.0 PHP versions can be toggled from the interface.

Both PHP 4 and 5 packages work as DSO Apache module and CLI utility. You can configure Apache to support whether PHP 4 or PHP 5. The initial version is launched through DSO mechanism at Apache start. The other one can be started through cgi-exec mechanizm.

To toggle PHP from the interface:

  1. Enter your administrator control panel.
  2. Go to E.Manager -> Servers > P. Servers menu
  3. Find the needed web-server and click the button near it:
  4. Choose the other version and click Submit:

    This launches the script /hsphere/shared/apache/bin/usephp <version> which is included in the hsphere-apache package, where <version> is the targeted php version. If launched without specifying the version, the script activates the default php version. To see parameters of the script, run:

    /hsphere/shared/apache/bin/usephp --help

    The script

    • makes changes in ~http/conf/httpd.conf with regard to running the needed module
    • changes the <IfModule mod_phpX.c> directive in the ~httpd/conf/sites/*.conf
    • changes ~httpd/conf/php.ini to link to the needed .ini file


PHP Components



Ldap support has been included to php-core, which is one of the reasons why horde may start to slow down when sending mail. It happens because horde is trying to connect to available ldap servers that are very slow by themselves.



Another important peculiarity of the new PHP packages is support of pear. To view which packages from pear repository have been installed, run:

/hsphere/shared/phpX/bin/pear list
To view the list of all pear packages available in the repository, run:
pear list-all
To check which pear packages need to be upgraded, run:
pear list-upgrades
To upgrade all pear packages installed, run:
pear upgrade-all



As for the PECL repository, 2 packages from it (Fileinfo and SQLite) have been included to PHP4 and one (Fileinfo) to PHP5. In PHP5, SQLite is supported from php-core.


Objects in PHP 5

PHP5 has undergone some principal changes in the way it works with objects. That is why some programs that work fine with PHP4 may not work with PHP5. To ensure PHP5 support, all third-party products included to H-Sphere have been updated to the latest available version.


PHP Test Page

New PHP packages have been assembled to perfectly fit mail web-interfaces, and horde in particular. This means that PHP test page can be obtained from http:/box_IP/horde/test.php. Here, pay attention to memory_limit value. We recommend that it is either -1 (disabled) or 8 MB.


Customizing php.ini Configuration File

If you want to customize PHP config files for PHP 4 and PHP 5, please refer to Customizing Server Configuration Files By Means Of Templates.

© Copyright 2018. Parallels Holdings. All rights reserved.