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 lets you install another PHP version in your environment. Specify a PHP minor version when running this command, for more information, see Supported Platforms and Versions.

For example:

zendphpctl php install {PHP_VERSION}

Where {PHP_VERSION} is an argument used to set the PHP minor version to configure.
Default: If not provided, it uses the default PHP version; for more information, see the command php set-default.

Example:

zendphpctl php install 8.2

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