Compare operation modes of the PHP-scripts interpreter.
The following modes are available:
- PHP as Apache module
- PHP as CGI
- PHP as FastCGI
To set up PHP operation mode for a web-site go to ISPmanager -> WWW domains -> select a WWW domain -> select a required PHP mode, if all these modes are allowed for a WWW-domain’s owner.
PHP as Apache module
The apache mod_php module of the Apache web server is used.
Benefits:
- The scripts are running at the highest speed in comparison with other methods.
- The server processes the scripts itself.
- Single configuration file for all the scripts (php.ini).
- You can set PHP configuration variables in the web-server configuration file or using the .htaccess file.
Drawbacks:
- All the scripts are running with privileges that the web-server uses, thus if you want to add something to the directory, you need to make it accessible for everybody.
- If you use scripts to start the third party applications (e.g. mailing), it is impossible to identify the user who run the process.
- It overloads the web-sever; Apache that handles the scripts may show statistical information too slow.
- Errors in scripts may cause failure of the entire web-server.
PHP as CGI
If you are using PHP as CGI, PHP scripts are transfered directly to the PHP interpreter.
Benefits:
- All the scripts are running with privileges of the WWW domain’s owner.
- You can configure PHP individually for each user.
- Consumes less operating memory in comparison with the Apache module.
- Errors in scripts do not cause failure of the web-server.
Drawbacks:
- Some server variables are not transferred to the php-script causing problems with authorization using PHP (the Header command).
PHP as FastCGI
The mod_fastcgi module is used. It transfers scripts to the PHP interpreter.
Benefits:
- Due to caching of some intermediate data, the script is not always interpreted while being executed, and greater speed is achieved in comparison with the PHP as CGI mode.
Drawbacks:
- User’s extra process (php-cgi) is stored after the first call to the process.
Posted on January 29, 2010







