3.3.2 PHP settings: operating modes, version selection and extension enabling
PHP is a widely used general purpose programming language specifically designed for web development. It is often used to create dynamic websites and web applications. The central element of working with PHP is its interpreter, software that converts PHP code into executable code that can be executed by a web server.
ISPManager4 panel, which is installed on all our hosting services and can be provided for use on virtual/ dedicated server, supports two methods of working with PHP. Namely:
1. PHP as CGI (Common Gateway Interface):
- Installed by default.
- Has access to the PHP Settings tab, the settings in which are applicable to all sites in this mode within one hosting account.
- Allows you to easily connect extensions using the PHP Extensions tab.
- Supports the use of any of the PHP versions installed on the hosting.
- In this mode, PHP is launched by a separate process each time a PHP script is requested.
- A web server (such as Apache) passes a request to execute a PHP script to a PHP executable, which processes the script and returns the result to the web server.
- Provides greater isolation between processes and increases security since each request is executed in a separate PHP process.
- However, may be less performance efficient due to the overhead of starting and ending the PHP process for each request.
2. PHP as an Apache module:
- Limited to using only one pre-installed version of PHP (on hosting it is 5.3.10, on virtual/dedicated servers depending on the OS version, the selected recipe and the settings of the installed software).
- In this mode, PHP runs as a built-in module in the Apache web server.
- PHP scripts are processed directly within the Apache process.
- Provides faster execution of PHP scripts since each request does not require starting a new PHP process.
- However, this can also lead to performance and security issues if there are a large number of requests to be processed or if vulnerabilities are exploited in PHP.
In general, we recommend using PHP as CGI as the PHP mode for your websites.
Changing the operating mode from PHP in the ISPManager4 panel
The interpreter mode can be set separately for each WWW domain.
By default, the PHP interpreter mode for all new WWW domains is set to PHP as CGI.
If for any reason the mode needs to be changed, this is done in the control panel as follows:
1. Go to the WWW domains tab. Select the desired WWW domain and click the Edit. button in the upper right corner.
2. In the PHP column you can change the method of working with PHP for a particular site.
PHP settings
If you have at least one WWW domain installed in PHP as CGI in your panel, the PHP configuration tab becomes available to you.
Tip: If you just changed the method and the tab is still not visible, simply refresh your browser page.
In PHP Settings you can change the version of PHP, some variables of the configuration file php.ini and time zone. The specified settings apply to all WWW domains installed in PHP as CGI within one user:
Important: on hosting services, restrictions on the use of resources by type Memory limit or Max. request size are set at the tariff plan level. Changing variables in the PHP Settings tab or using php.ini
will have no effect.
PHP extensions
If you have at least one WWW domain installed in PHP as CGI in your panel, the PHP extensions tab becomes available to you.
In the PHP Extensions tab you can enable or disable the PHP libraries you need without having to edit the php.ini
file: