Standalone PHP Installation
(H-Sphere 2.4.x; outdated since H-Sphere 2.5)
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.
This step-by-step guide explains how to set up PHP in the standalone mode.
- Log into the target (e.g. web) server as root.
- Download PHP sources (any), extract the archive, and enter the directory.
- Compile and install standalone PHP:
./configure --prefix=/hsphere/shared/apache/php \
--localstatedir=/var/hsphere/php && make && make install
You can add other options, too.
- Create directory for PHP binary code and set the following ownership and permissions for it:
chown -R root:root /hsphere/local/bin
chmod -R 755 /hsphere/local/bin
- Copy PHP binary code into this directory:
cp /hsphere/shared/apache/php/bin /hsphere/local/bin/php
- Add the following lines to /hsphere/local/config/httpd/httpd.conf :
AddType application/x-httpd-php-external .php4 .phpext
Action application/x-httpd-php-external "/hsphere/local/bin/php"
#.php4, .phpext - extensions for scripts executed with external php as a user
ScriptAlias /php/bin/ /hsphere/local/bin/
- Create directory cgi-php inside domain's home directory for php scripts to work through CGI
and set the following ownership and permissions for it:
* Make sure all php scripts in this directory have permissions 755 and domain owner's ownership.
chown user:user cgi-php
chmod 755 cgi-php
- Include new CGI directory into domain's VirtualHost config:
ScriptAlias /cgi-php "/hsphere/local/home/user/domain/cgi-php"
where <user> and <domain> are the user's and name and domain's home directory.
* Note, that when an end user clicks the Apply changes link on the Web Options page,
php scipts will stop working through CGI for their account.
- All php scripts in this directory must call binary php.
echo ("Test string");
- Set the following permissions for /hsphere/local/var/httpd/logs/suexec_log:
chmod 666 /hsphere/local/var/httpd/logs/suexec_log
* This is quite insecure. We are in process of solution to it.
- Execute apache config test and ensure there are no errors in the config file:
- Restart apache:
© Copyright 2018. Parallels Holdings. All rights reserved.