H-Sphere Documentation Sysadmin Guide


Standalone PHP Installation


This step-by-step guide explains how to set up PHP in the standalone mode.

  1. Log into the target (e.g. web) server as root.
  2. Download PHP sources (any), extract the archive, and enter the directory.
  3. Compile and install standalone PHP:
    ./configure --prefix=/hsphere/shared/apache/php \
            --with-zlib-dir \
            --with-jpeg-dir \
            --with-png-dir \
            --with-gd \
            --with-mysql=/usr \
            --with-gettext \
            --disable-debug \
            --enable-versioning \
            --enable-sockets \
            --enable-track-vars \
            --with-pgsql=/usr \
            --enable-ftp \
            --localstatedir=/var/hsphere/php && make && make install

    You can add other options, too.


    • In versions before 4.3.0, php doesn't come with GD, and if you want to use your own GD library, specify the location:
      --with-gd=/hsphere/shared \
    • On FreeBSD systems, use the following paths for mysql and pgsql:
      with-mysql=/usr/local \
      with-pgsql=/usr/local \
  4. 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 "/php/bin/php"
              #.php4, .phpext - extensions for scripts executed with external php as a user
              <Directory /hsphere/shared/apache/php/bin>
              Options +ExecCGI
              ScriptAlias /php/bin/ /hsphere/shared/apache/php/bin/
  5. Execute apache config test and ensure there are no errors in the config file:
    /hsphere/shared/apache/bin/apachectl configtest
  6. Restart apache:
    /hsphere/shared/apache/bin/apachectl stop
    /hsphere/shared/apache/bin/apachectl start

User comments
No comments for this page.
Add comment

Home   Products   Services   Partners   Support   News   Contact   Forum
© 2020 psoft.net.
All rights reserved.