Script Language Settings
The Script Language Settings page provides advanced interactions of your websites. You can customize multiple environments by creating different profiles.
Contents
PHP
At the PHP tab, you can manage two types of PHP profiles:
- Package-Based Profiles: Profiles under this category are automatically created once service packages are installed. These profiles can be edited but cannot be deleted, and can only apply to their corresponding service packages.
- Customized Profile: Profiles that can be created, edited, and deleted by users.
To create a customized profile:
- Click Create.
- Fill in the Profile name and Description fields for this profile.
- Select a PHP back-end version from the PHP version drop-down menu.
- Configure your profile settings at the following tabs:
- Settings: General settings for the profile, such as PHP caches, Xdebug, and error messages.
- Extensions: Enable or disable extensions available in the profile.
- FPM: Adjust the settings of PHP FastCGI Process Manager (FPM).
- Core: Configure the php.ini directives of the profile.
- Confirm the settings and click Create.
To edit the general settings:
At the Settings tab, you can configure various general settings, including PHP caches, Xdebug, error message display, and open_basedir.
- On the Script Language Settings page, select a PHP profile and click Edit, or double-click on a PHP profile.
- Go to the Settings tab.
- Configure the following settings according to your needs:
- Enable PHP cache: Tick this checkbox if you want to enhance PHP performance. However, it may not take effect under some circumstances.
- Enable Xdebug: Tick this checkbox if you want to enable Xdebug, which is a PHP extension that provides debugging capabilities.
- Enable display_errors to display PHP error message: Tick this checkbox if you want to display PHP error messages on the webpage.
- open_basedir: The open_basedir function indicates the paths from which PHP is allowed to access files.
- Select Customized and fill in the path in the text field to customize open_basedir.
- Select Default to use the system default settings.
- Click Save to apply the settings.
Note:
- Use a colon (:) to separate each path for your open_basedir, such as /etc:/tmp:/usr/bin/php.
- For security reasons, paths for the homes shared folder (e.g., /volume1/homes) cannot be added to open_basedir.
To edit the extensions:
At the Extensions tab, you can customize your profiles by managing extensions, such as bz2, curl, dba, gd, pgsql, session, and sqlite3.
- On the Script Language Settings page, select a PHP profile and click Edit, or double-click on a PHP profile.
- Go to the Extensions tab.
- Tick the checkboxes of the extensions you want to enable on the extension list.
- Click Save to apply the settings.
Note:
- Each package-based profile has one or more required extensions. The checkboxes of the required extensions are unavailable and cannot be ticked. Only the non-required extensions can be managed.
To edit the FPM settings:
At the FPM tab, you can adjust the settings of PHP FastCGI Process Manager (FPM), which is an alternative PHP FastCGI implementation with features for heavy-loaded sites.
- On the Script Language Settings page, select a PHP profile and click Edit, or double-click on a PHP profile.
- Go to the FPM tab.
- Modify the following values according to your needs:
- FPM mode: You can set the FPM mode to Dynamic, Static, or On demand.
- Max processes
- Start servers
- Min spare servers
- Max spare servers
- Click Save to apply the settings.
Note:
- Refer to the PHP official website for more information on FPM settings.
To edit the core settings:
The Core tab contains all php.ini directives of your PHP profiles, such as sendmail_path and sendmail_from.
- On the Script Language Settings page, select a PHP profile and click Edit, or double-click on a PHP profile.
- Go to the Core tab.
- Find a php.ini directive that you want to edit. You can enter its name into the search bar.
- Edit the value in the right column of the specified directive.
- Click Save to apply the settings.
To reset the php.ini values:
- On the Script Language Settings page, select a PHP profile and click Edit, or double-click on a PHP profile.
- Go to the Core tab.
- Select Customized from the drop-down menu. You will see all the php.ini directives you have modified.
- Do either of the following to reset php.ini values:
- Reset selected: Click on a php.ini and select Reset selected from the drop-down menu. You can also select more than one php.ini using the Ctrl key.
- Reset all: Select Reset all from the drop-down menu.
- Click Save to apply the settings.
Python
At the Python tab, you can manage customized profiles that can be created, edited, and deleted.
To create a customized profile:
- Click Create.
- Fill in the Profile name and Description fields for this profile.
- Select a Python back-end version from the Python version drop-down menu and click Next.
- Set up uWSGI by filling in the following information, and then click Next.
- Process: The number of processes that uWSGI can simultaneously activate.
- Enable threads: Each process contains one thread by default. Enable this option to allow a process to contain multiple threads.
- Number of threads: The number of threads running a single process.
- Max. request count: Processes will restart after the maximum number of requests is reached.
- Buffer size (bytes): The buffer size for each request's headers.
- Add Python modules by using the search bar, or by clicking the Browse button to upload a requirements file (requirements.txt) from local storage. Click Next.
- Module Name: The name of the module.
- Default Version: You can use the Latest version or Customize a module version. For example:
- Project_name
- Project_name == 1.3
- Project_name >=1.2,<2.0
- Project_name[foo, bar]
- Project_name~=1.4.2
- Action: Click
to remove a module.
- Confirm the settings and click Create.
Note:
- The format of a requirements.txt file must follow the format of a requirement specifier, which is composed of a project name followed by optional version specifiers. Refer to the pip official document website for more information on requirement specifiers.
To edit the general settings:
At the Settings tab, you can edit the general settings.
- On the Script Language Settings page, select a Python profile and click Edit, or double-click on a Python profile.
- Go to the Settings tab.
- Edit the profile name, description, and Python version according to your needs.
- Click Save to apply the settings.
To edit the uWSGI settings:
At the uWSGI tab, you can adjust the settings of Python uWSGI, which is an alternative Python uWSGI implementation with features for heavy-loaded sites.
- On the Script Language Settings page, select a Python profile and click Edit, or double-click on a Python profile.
- Go to the uWSGI tab.
- Edit the following values according to your needs:
- Process: The number of processes that uWSGI can simultaneously activate.
- Enable threads: Each process contains one thread by default. Enable this option to allow a process to contain multiple threads.
- Number of threads: The number of threads running a single process.
- Max. request count: Processes will restart after the maximum number of requests is reached.
- Buffer size (bytes): The buffer size for each request's headers.
- Click Save to apply the settings.
Note:
- Refer to the uWSGI official document website for more information on uWSGI settings.
To edit the modules:
At the Module tab, you can customize your profiles by managing modules, such as Flask and Django.
- On the Script Language Settings page, select a Python profile and click Edit, or double-click on a Python profile.
- Go to the Module tab.
- Manage Python modules by using the search bar or by clicking the Browse button to upload a requirements file (requirements.txt) from local storage.
- Module Name: The name of the module.
- Default Version: Select Latest to use the latest version or select Customize to customize a module version. For example:
- Project_name
- Project_name == 1.3
- Project_name >=1.2,<2.0
- Project_name[foo, bar]
- Project_name~=1.4.2
- Action: Click
to remove a module.
- Click Save to apply the settings.
Note:
- The format of a requirements.txt file must follow the format of a requirement specifier, which is composed of a project name followed by optional version specifiers. Refer to the pip official document website for more information on requirement specifiers.