Plesk provides full support for the PHP scripting language, including support for multiple PHP versions and handler types out of the box. This topic explains how Plesk administrator can make PHP available to their customers and control what PHP settings their customers can manage.
For a domain to use PHP, it has to be enabled on the subscription level. If the subscription is based on a service plan, it makes sense to enable PHP and configure the PHP settings in the service plan. For example, you can have a 'basic' plan, which would give subscribers no control over PHP settings, and 'advanced' one, which would give some degree of control, and an 'expert' one, which would allow subscribers the maximum ability to customize the PHP settings.
When setting up a service plan or a subscription, PHP-related tasks include the following:
Most PHP versions are not backward-compatible. For example, code written in PHP 5.x might not execute correctly when being run using a PHP 4.x interpreter. For additional flexibility, Plesk ships with a number of PHP versions that can be installed via the Plesk interface. Customers granted the PHP version and handler management permission are able to select the PHP handler and version independently for each of their websites.
To configure the PHP settings for a service plan, go to Service Plans > click either Add a Plan or the name of an existing plan whose PHP settings you want to change > PHP Settings. To configure the PHP settings for a subscription, go to Subscriptions > click either Add Subscription or the name of an existing subscription whose PHP settings you want to change and then Customize > PHP Settings. On this page you are able to do the following:
php.ini
. For example, if you want to automatically load the mSQL
extension, add the line: extension=msql.so
.Note: Setting additional PHP directives is available to the administrator only and is never available to a customer. When the administrator sets additional PHP directives to a particular subscription, the subscription does not get the Locked status. Therefore, the added directives and other changes in PHP settings can be lost when the subscription is synchronized with the service plan.
These settings will become the default ones for objects of lower levels. In other words, settings configured on the service plan level will become the default for all subscriptions based on that service plan, and settings configured on the subscription level will become the default for all domains based on that subscription.
To configure the PHP settings for a service plan, go to Service Plans > click either Add a Plan or the name of an existing plan whose PHP settings you want to change > Permissions. To configure the PHP settings for a subscription, go to Subscriptions > click either Add Subscription or the name of an existing subscription whose PHP settings you want to change and then Customize > Permissions. On this page the following permissions govern the ability to change the PHP settings:
Note that some of these permissions can be granted without granting the Hosting settings management permission first.
Note that in Plesk local settings override global ones. This means that, for example, settings defined on the subscription level take precedence over those defined on the service plan level, but are, in turn, overridden by those defined on the domain level.
Note: If you change the PHP settings for a subscription, the subscription will be locked for sync unless the subscription owner has the necessary permissions to make the changes you made.
This scheme illustrates the hierarchy, from the topmost level to the bottom: