Parallels H-Sphere Documentation System Administrator Guide

 

PHP Compilation

(outdated since H-Sphere 2.5)
 
 

Related Docs:   PHP Compilation (HS 2.5+) PHP IMAP Compilation PHP Safe Mode Configuration Example php.ini File 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.

To add additional PHP features or update PHP to a later version, you need to recompile PHP on your web box. H-Sphere PHP is compiled as a standard DSO module and can be reinstalled at any moment without major problems. To recompile your PHP:

  1. Create the osdep.h link if it's not there:
    Linux:
    # ln -s /hsphere/shared/include/c-client/os_slx.h \
    /hsphere/shared/include/c-client/osdep.h
    FreeBSD:
    # ln -s /hsphere/shared/include/c-client/os_bsf.h \
    /hsphere/shared/include/c-client/osdep.h
  2. From the command line, run the following commands:
    cd /hsphere/shared/apache/htdocs
    echo "<?phpinfo(1)?>" > opt.php
  3. In your browser's address field, type http://your_site/opt.php where your_site is your site's domain name. You will get the page with your current PHP settings.
  4. Copy the content of the Configure Command section. These are the options you will need to include when you configure your PHP.
  5. Change dir to your PHP sources.
  6. Run the following commands:
    EAPI_MM=/hsphere/shared
    export EAPI_MM
  7. Paste the line you copied from the Configure Command section. Remove all single quotes embracing values in this line. Add more parameters if you need them for your custom options. Mind that PHP version 4.3.0 and higher comes bundled with its own GD library, and if you want to use it, replace
    --with-gd=/hsphere/shared \
    with
    --with-gd \
    You may also need to add the option:
    --with-openssl=/hsphere/shared
    Press Enter.
  8. When configure finishes, type make to compile PHP.
  9. Type make install to install PHP.
  10. Restart Apache.

Warning for PHP Update from H-Sphere earlier than 2.3 RC4:
It is highly recommended that you update your PHP to version 4.3 to have the new version of WebShell running. However, mind the following:
- the /usr/local/lib/php.ini file is backed up and then replaced during the update (by the H-Sphere default php.ini file).
  If you have custom php.ini settings, check the file after the update and reconfigure it according to your requirements;
- new version of PHP doesn't support some of the old PHP scripts that may cause problems;
- osCommerce 2.0 may stop running, so make sure to update osCommerce to version 2.2.

Check out our forum on PHP compilation options for H-Sphere 2.3.1

If one of your servers has IMP installed, make sure to have its PHP compiled with IMAP support.

 

Troubleshooting

While compiling PHP, I receive the error that libzzip is not found

H-Sphere default static PHP package includes the libzzip package. However, if you make your custom PHP build, you should have the libzzip package installed. For Linux, download and intall it according to the instructions on the SourceForge site. For FreeBSD, install it under root in the following way:

# cd /usr/ports/devel/zziplib
# make install clean


Related Docs:   PHP Compilation (HS 2.5+) PHP IMAP Compilation PHP Safe Mode Configuration Example php.ini File Software Recompilation Request



© Copyright 2017. Parallels Holdings. All rights reserved.