Installing ZendPHP on IBM i

This topic describes the procedures for installing ZendPHP on IBM i.

Initial setup

The initial setup of the Open Source Environment, $HOME directory, and $PATH is identical to that detailed in the Zend Server for IBM i installation instructions. The initial setup only needs to be done on a machine that does not have Open Source Environment configured.

Once the Open Source Environment is configured, follow the instructions below to install ZendPHP on IBM i.

Installation

Zend provides a script for managing installation and uninstallation, which you can retrieve via the following commands:


==> wget https://downloads.zend.com/zendphp/ibmi/zendphp_manage.sh
==> chmod ug+x zendphp_manage.sh

This script installs the ZendPHP yum repository and installs the requested version of ZendPHP.

Call ./zendphp_manage.sh --version=<PHP version> to install a specific ZendPHP version. (Use the --help option to get full details on how to use the tool.)

The default install contains the following:

  • CLI and CGI binaries.
  • Common package with the basic set of extensions.
  • ibm_db2 extension for PHP.
  • XML Toolkit.
  • Apache configuration.

After the installation, the Apache web server is started with the installed PHP version on port 10080. Additional PHP versions can be installed side by side; these installations do not alter the Apache configuration. Apache will continue to run with the PHP version that it was installed with initially.

Installing LTS packages

To install an LTS version of ZendPHP (currently 5.6, 7.1, and 7.2), you will need to provide your credentials. The zendphp_manage.sh script creates a file /QOpenSys/etc/yum/repos.d/zendphp.repo. Open this file, and add the following lines:

username={LOGIN_OR_ORDER_ID}
password={PASSWORD}

Fill in the values {LOGIN_OR_ORDER_ID} and {PASSWORD} based on the credentials you were provided by your Zend sales representative. Once you have done so, you will be able to install LTS versions of ZendPHP using the same zendphp_manage.sh script used in previous examples, or using the yum package manager or the ACS Open Source Package manager.

Adding packages after initial install

When additional extensions are needed, these need to be installed separately. Since the repository has been added with the initial install, it can now be done from the ACS Open Source Package manager or from the command line. In either case the underlying program performing the work is yum.

Package naming follows a common format and contains the PHP version major and minor in the prefix for version specific packages. For example, packages compatible with PHP version 7.4 have the prefix "php74zend-php".

Installing additional extensions

For example, to install the mbstring extension for PHP version 7.3, run:

==> yum install -y php73zend-php-mbstring

or find the package from ACS open source package manager and install it from there.

Uninstall

Uninstall can be done either from the command line or from the ACS Open Source package manager. When wishing to uninstall all the packages for a specific ZendPHP version, the provided helper script can be used. Run zendphp_manage.sh --erase --version=<PHP version> to uninstall all ZendPHP packages for a specific PHP version.