Installing ZendPHP on Linux using zendphpctl

This topic describes the recommended procedure for installing ZendPHP on Linux using the zendphpctl script. The advantage of using the zendphpctl script is that it supports managing your ZendPHP installation including registering the ZendPHP package repository, installing and configuring different PHP versions, enabling and configuring PHP-FPM, and the management of PHP extensions.

Requirements

The zendphpctl script is supported on any Linux distribution supported by ZendPHP, as listed in the Supported Platforms and Versions topic.

Getting the installer

To get the zendphpctl script:

  1. Download the zendphpctl script and its signature from our repository:
    $ curl -L https://repos.zend.com/zendphp/zendphpctl -o zendphpctl
    $ curl -L https://repos.zend.com/zendphp/zendphpctl.sig -o zendphpctl.sig
  2. Validate the signature:
    echo "$(cat zendphpctl.sig) zendphpctl" | sha256sum --check
  3. If the signature is valid, remove the signature file, then set permissions for the script:
    $ rm zendphpctl.sig
    $ chmod +x zendphpctl

You can either use the script immediately from its current location, or place it somewhere in your $PATH (For example, /usr/local/bin).

Installing the ZendPHP repository using zendphpctl

The 'repo-install' command allows you to install the ZendPHP package repository on your system. You can also provide your credentials to allow immediate access to LTS editions of ZendPHP. If you specify your credentials, you must provide both the --account and --password flags.

For example:

zendphpctl repo-install

Where [options] are any of the following:

Name Short name Description
--account <account>   (Optional) Account or order identifier associated with your credentials
--password <password>   (Optional) Password associated with your credentials

Example 1:

zendphpctl repo-install

Example 2:

zendphpctl repo-install --account ORDER_ID --password PASSWORD

Installing PHP versions using zendphpctl

The 'php-install' command allows you to install another PHP version in your environment. A PHP minor version must be specified when running this command. The following minor versions are currently supported: 7.2, 7.3, 7.4, 8.0, 8.1, and 8.2.

For example:

zendphpctl php-install [PHP]

Where [PHP] is an argument used to set the PHP minor version to configure (uses default if not provided, see 'php-set-default').

Example:

zendphpctl php-install 8.2

For more information about the script, see the command reference document.