Article ID: 3185, created on Nov 30, 2007, last review on May 11, 2014

  • Applies to:
  • H-Sphere



PHP Packages Since 2.5

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

  • hsphere-php4-X.X-X
  • hsphere-php4-plugins-4.X.X-X
  • hsphere-php5-5.X.X-X
  • hsphere-php5-plugins-5.X.X-X
  where X.X-X is the latest available package version.



This package contains default php compilation:, php, pear, phpize, etc. and default extenions: bcmath, bz2, curl, domxml, fileinfo, ftp, gd, gettext, gmp, iconv, imap, mcal, mcrypt, mhash, mnogosearch, mysql, odbc, pgsql, sockets, sqlite, swf, zip, zlib.



This one contains some 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.


Toggling PHP Versions

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, or both. The initial version is launched through DSO mechanism at Apache start. The other one can be started through cgi-exec mechanizm.

PHP versions can be toggled via the interface (by default, PHP 4 is enabled). Use E.Manager -> P. Servers menu, find the needed web-server and click the button near it:

Then 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 themserlves.



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.

f213b9fa8759d57bee5d547445806fe7 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF