1. Home
  2. Technical
  3. PHP
  4. Differences between PHP modes (FastCGI and CLI)

Differences between PHP modes (FastCGI and CLI)

On our virtual servers and private servers, PHP scripts can run in two different modes:

  • FastCGI (the default mode)
  • CLI

FastCGI mode is enabled by default. The advantage of FastCGI is that PHP can run with user privileges. This mainly means higher security and less problems with file permissions. In CGI mode, it’s possible to choose exactly which PHP modules to use.

The PHP CLI is mainly used for Crontab jobs. It is also possible to create a separate php.ini file with the PHP CLI. Please note that PHP modules are not loaded by default in this mode. PHP modules can be loaded using the PHP CLI mode with the dl() function. For example: dl(“php_soap.so”)

By default the same PHP version is used in the console as the web server’s main domain PHP.

 

Updated on 19. Apr 2024
Was this article helpful?

Related Articles