PHP
Manage users' PHP versions: list enabled, list available, change version, etc.
Get version for a domain
To view the current PHP version used by a domain, run the following command:
opencli php-domain <DOMAIN-NAME>Example:
# opencli php-domain pejcic.rs
Domain 'pejcic.rs' (owned by user: stefan) uses PHP version: php8.1Change version for a domain
To change a PHP version for a domain name run the domain script with --update flag::
opencli php-domain <DOMAIN-NAME> --update <PHP-VERSION>Example:
# opencli php-domain pejcic.rs --update 8.3
Updating PHP version to: 8.3
Domain 'pejcic.rs' (owned by user: stefan) uses PHP version: php8.3
Updating PHP version in the Apache configuration file...
* Reloading Apache httpd web server apache2
*
Updated PHP version in the configuration file to 8.3View default version
The default PHP version for a user determines which PHP version will be used for all domains that the user adds in the future. It does not change the PHP version for any existing domains.
To list the currently set default PHP version for a user, run the following command:
opencli php-default <USERNAME>Example:
# opencli php-default stefan
Default PHP version for user 'stefan' is: php8.3Change the default version
To update the default PHP version for a user use the php-default with --update flag and provide the new PHP version.
opencli php-default <USERNAME> --update <VERSION>Example:
# opencli php-default stefan --update 8.1
PHP version for user 'stefan' updated to: 8.1List installed versions
To list all installed PHP versions for a user, run the following command:
opencli php-installed_versions <USERNAME>Example:
# opencli php-installed_versions stefan
php7.4
php8.1
php8.2List available versions
To get available (that can be installed) PHP versions for users' container, run the following command:
opencli php-available_versions <USERNAME>Example:
# opencli php-available_versions stefan
....
PHP versions for user stefan have been updated and stored in /home/stefan/etc/.panel/php/php_available_versions.json.The script will by default update users' available PHP versions setting for the UI, optionally you can add --show flag to display the available versions.
opencli php-available_versions <USERNAME> --showExample:
# opencli php-available_versions stefan --show
....
Available PHP versions for user stefan:
php8.1-fpm
php5.6-fpm
php7.0-fpm
php7.1-fpm
php7.2-fpm
php7.3-fpm
php7.4-fpm
php8.0-fpm
php8.2-fpm
php8.3-fpmThe available_versions script performs various actions:
- Runs
apt-get updateinside users container - Lists available PHP versions from remote repositories
- Saves the list to
/php_available_versions.jsonin user home directory - optionally display the listf
PHP.INI
View or update current setting value from php.ini file for user:
opencli php-ini <username> <action> <setting> [value]- You can specify a custom link from which to download files, by creating a file
/etc/openpanel/php/ioncube.txtand setting link in it.