PHP

From Servage Wiki
Jump to: navigation, search

Contents

Where can I find more information on PHP?

We would suggest visiting the official PHP website which can be found at http://www.php.net


Which PHP version is Servage using?

All our clusters are having multiple version of PHP available to suite any situation. We are still having PHP4 available as cgi-php for backwards compatibility reasons but do not recommend to use it as PHP4 is no longer maintained by the PHP-developers. Therefore we recommend using PHP5 if possible, because PHP4 may not be supported any longer in the near future.

Currently PHP5 versions 5.2, 5.3 and 5.4 are available and select-able on a per virtual host base in our controlpanel. At this point PHP 5.2 is the default choice for new hosts but this will change in the near future.


How to change the memory size limit for PHP?

You can increase the memory size limit for php yourself:

a) create a .htacces file in the root folder of the respective domain
b) add this line to the file:

php_value memory_limit xxM

Replace "xx" with the limit you wish to run.

How to diasable PHP error messages?

If you need to disable the PHP error messages, you just have to add the following lines to the .htaccess files:

php_flag display_errors off


How do I disable/enable PHP Safe Mode?

Please Note: PHP5.4 and newer does not have safe_mode support anymore !!!

You are able to turn on/off safe mode directly from your account.

  1. Click the "Webserver" tab in the left menu
  2. Select "Virtual hosts" and click on "List virtual hosts" for the domain you want to change.
  3. Select "Settings" on the subdomain or domain that you want to change.
  4. You should now be able to change safe mode settings.

It is however important that you are aware that disabling safe mode lowers your overall account security.

When safemode is disabled your account is more vulnerable towards insecure scripts, therefore it is very important that you are aware of this.

Please note it might take up to two hours before this change is visible.


Which PEAR modules are available?

Most PEAR modules are available in pure PHP code. These modules can easily be installed in any account locally by downloading the source, extracting it and include the .php file directly. But we do have a whole list of already installed modules available on our servers that are available for all customers. For a full list of globally installed PEAR modules visit this page: List of PEAR modules


How do I use the PEAR modules?

If you want to use any pre-installed PEAR module you can just include the required files. These files are loaded globally, so no need to download and upload these files manually. An example script:

 <?php
 require_once "HTTP/Request.php";
 
 $req =& new HTTP_Request("http://www.example.com/");
 if (!PEAR::isError($req->sendRequest())) 
 {
     echo $req->getResponseBody();
 }
 ?> 

Note: This requires PHP Safe Mode and Safe Mode GID to be turned off.

Personal tools
Navigation