Table Of Contents

APS PHP Runtime

APS team recommends using the APS PHP runtime to make your development process more effective and efficient. PHP runtime methods make the low level REST communication and security procedures on the interface between the APS controller and APS applications transparent for APS packagers. Otherwise, they have to develop the whole stack of communication protocols themselves or customize a third party solution.

Prerequisites

Make sure the following packages are installed on the system:

  • PHP 5.3 or later

  • PHP-XML

Download

Download the latest version of the APS PHP runtime relevant for your OS.

Installation

YUM based Linux (Red Hat / CentOS)

The following steps help you install PHP and APS PHP runtime on a Red Hat or CentOS system.

  1. Install the PHP and PHP-XML packages:

    # yum install php
    # yum install php-xml
    
  2. Use the typical rpm command to install the downloaded package:

    # rpm -ivh aps-php-runtime-{version}.noarch.rpm
    

The path to the APS PHP runtime folder /usr/share/aps/php will be added to the system php.ini file automatically.

Windows

The following steps help you install PHP and APS PHP runtime on Windows.

  1. Download and unzip the PHP package, for example, from PHP for Windows .

  2. Make sure the proper Microsoft Visual C++ Redistributable for Visual Studio version that supports the selected PHP package is installed.

  3. Make sure, the path to the folder with the unzipped PHP package is added to the PATH environment variable.

  4. To verify that the path works, type php -v in the command line to ensure the system can find the PHP runtime executable.

  5. Extract the APS PHP runtime package aps-php-runtime-x.x-yyy.zip to a directory, which path is included in the include_path environmental variable declared in the php.ini configuration file.

  6. The path to the APS PHP runtime folder aps\2\ should be inside the directory referred by the include_path variable.

Mac OS X

The following steps help you install PHP and APS PHP runtime on a Mac OS X system.

  1. Install the PHP on the system, for example, as explained in Installation on Mac OS X.

  2. Extract aps-php-runtime-x.x-yyy.zip to a directory, which is included in the include_path declared in the php.ini configuration file. For example, include_path=".:/php/includes".

  3. The path to the APS PHP runtime folder aps/2/ should be inside the directory referred by the include_path variable. In accordance with the above example, place the PHP runtime aps folder in the /php/includes/ folder.

Reference in APS PHP Scripts

Use the following directive at the very beginning of your APS PHP application:

<?
    require_once "aps/2/runtime.php";
    ...
?>

Follow documentation on APS PHP runtime to use the library effectively in your applications.