Table Of Contents

PHP Environment

The PHP environment APS type is designed to run applications written in the PHP programming language.

This environment performs a scenario typical for a web application:

  1. Extracts an application to the environment directory (note that the directory must be used exclusively by the environment).

  2. Sets up a virtual site (or directory) on the web server that will serve the environment. URL mapping must match the Type Definition interface definition for the application.

  3. Ensures backend security on the virtual site.

In this document:

PHP Environment Interface

The PHP environment is an environment with an installed PHP interpreter, based on the Base Environment. Applications that are compatible with this environment declare an URL Mapping element within their APP-META.xml.

The PHP Environment type schema (download):

{
    "apsVersion": "2.0",

    "name": "PhpEnvironment",

    "id": "http://aps-standard.org/types/infrastructure/environment/php/1.0",
    "implements": [ "http://aps-standard.org/types/infrastructure/environment/1.0" ],

    "properties": {
       "php": {
          "type": "Php"
       }
    },
    
    "structures": {
      "Php": {
        "type": "object",

        "properties": {

          "version":          { "type": "string", "required": false },
          "extensions":       { "type": "array", "items": { "type": "string" } },

          "allowUrlFopen":    { "type": "boolean" },
          "fileUploads":      { "type": "boolean" },
          "safeMode":         { "type": "boolean" },
          "shortOpenTag":     { "type": "boolean" },
          "registerGlobals":  { "type": "boolean" },
          "magicQuotesGpc":   { "type": "boolean" },

          "memoryLimit":      { "type": "integer" },
          "maxExecutionTime": { "type": "integer" },
          "postMaxSize":      { "type": "integer" }
        }
      }
    }
}

When a PHP interpreter is available in the environment, a list of engines of the environment should have a ‘php’ element.

PHP Version

The resource property version defines the full version of a php interpreter.

"php": {
   "version": "5.4.1"
 }

PHP Extensions

The resource array property extension defines all available php extensions.

"php": {
   ...
   "extentions": [ "curl", "Zend Optimizer", "ionCube Loader" ]
   ...
}

PHP Settings

"php": {
   ...
   "allowUrlFopen": true
   ...
}

They define states of the following php interpreter options:

Setting name

Corresponding PHP option

allowUrlFopen

allow_url_fopen

fileUploads

file_uploads

safeMode

safe_mode

shortOpenTag

short_open_tag

registerGlobals

register_globals

magicQuotesGpc

magic_quotes_gpc

Please refer to the PHP documentation for the details on each parameter.

PHP Limits

"php": {
   ...
   "memoryLimit": 16777216
   ...
}

PHP Limits are declared in the following fields of the configuration structure:

Setting name

Corresponding PHP option

memoryLimit

memory_limit in bytes.

maxExecutionTime

max_execution_time in seconds.

postMaxSize

post_max_size in bytes.

Please refer to the PHP documentation for the details on each parameter.