H-Sphere Sysadmin Guide

PHP Safe Mode Configuration

 
 
Important: PHP safe mode is not supported by psoft.net, you can use it at your own risk.

PHP safe mode is turned off by default in the original H-Sphere configuration.

To turn it on, set safe_mode=On in the php.ini file (usually, in the /usr/local/lib directory).

To use default H-Sphere configuration for PHP with safe mode on, download the default php.ini for H-Sphere 2.4.x, or take the default php.ini installed with standard H-Sphere PHP packages for H-Sphere 2.5 and up, turn the safe mode on and copy that file to the PHP installation directory (usually, /usr/local/lib).

Read more on PHP safe mode configuration in PHP documentation.

To turn the safe mode off for an individual account, edit/add the following directive in the /hsphere/local/config/httpd/httpd.conf Apache configuration file on the Web server:

<Directory /hsphere/local/home/wwwuser>
   <IfModule mod_php4.c>
      php_admin_flag safe_mode off
      php_admin_value upload_tmp_dir "/tmp"
      php_admin_value session.save_path "/tmp"
   </IfModule>
</Directory>

To have IMP Horde web mail working when the safe mode is on, set the following directive in /hsphere/local/config/httpd/httpd.conf on the Web server:

<Directory /hsphere/shared/apache/htdocs/horde>
   <IfModule mod_php4.c>
      php_admin_flag safe_mode off
      php_admin_value upload_tmp_dir "/tmp"
      php_admin_value session.save_path "/tmp"
   </IfModule>
</Directory>

To configure Webshell 4 so that it would work with the safe mode globally on:

<Directory /hsphere/shared/apache/htdocs/webshell4>
   <IfModule mod_php4.c>
      php_admin_flag safe_mode off
      php_admin_value upload_tmp_dir "/tmp"
      php_admin_value session.save_path "/tmp"
   </IfModule>
</Directory>

Note: In H-Sphere 2.5 and up where PHP 5 is introduced, also add all of the above block but with mod_php5.c module:

<Directory /hsphere/local/home/wwwuser>
   <IfModule mod_php5.c>
      php_admin_flag safe_mode off
      php_admin_value upload_tmp_dir "/tmp"
      php_admin_value session.save_path "/tmp"
   </IfModule>
</Directory>
<Directory /hsphere/shared/apache/htdocs/horde>
   <IfModule mod_php5.c>
      php_admin_flag safe_mode off
      php_admin_value upload_tmp_dir "/tmp"
      php_admin_value session.save_path "/tmp"
   </IfModule>
</Directory>
<Directory /hsphere/shared/apache/htdocs/webshell4>
   <IfModule mod_php5.c>
      php_admin_flag safe_mode off
      php_admin_value upload_tmp_dir "/tmp"
      php_admin_value session.save_path "/tmp"
   </IfModule>
</Directory>

Restart Apache after performing necessary modifications.

 



© Copyright 1998-2007. Positive Software Corporation.
All rights reserved.