Install 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.

Get the installer

To get the zendphpctl script:

  1. Download the zendphpctl script and its signature from our repository:

    Copy
    $ 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:

    Copy
    echo "$(cat zendphpctl.sig) zendphpctl" | sha256sum --check
  3. If the signature is valid, remove the signature file, then set permissions for the script:

    Copy
    $ 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).

Install 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:

Copy
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:

Copy
zendphpctl repo install

Example 2:

Copy
zendphpctl repo install --account ORDER_ID --password password

Update the ZendPHP repository key for Ubuntu 24.04

For installations of the ZendPHP repository for Ubuntu 24.04 performed using the zendphpctl script, use the following commands to update the repository key for Ubuntu 24.04:

Copy
# Update the zendphpctl utility itself
zendphpctl self-update
# Reconfigure the ZendPHP repository
zendphpctl repo install

If you created the ZendPHP repository manually using the apt-key command, use the original procedure and replace the key URL with  https://repos.zend.com/zend-2025.key. For details, see Install ZendPHP on Debian and Ubuntu (DEB).

Install 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 Manage your ZendPHP installation using zendphpctl.