PHP connection in mod_cgi mode

PHP on a VPS server can work in two modes - mod_php and mod_cgi.

The default is mod_php mode. You can also enable mod_cgi mode.

1. Connect to your VPS server via ssh.

2. Enter the cgi-bin folder on your site with the following command:

cd site-directory/public_html/cgi-bin/

3. Create a link with the following command:

ln -s /opt/php5.3/bin/php-cgi php7.3.cgi

You can replace php7.3 with any other version.

4. Copy the php.ini file with the following command (without leaving the cgi-bin folder):

cp /etc/php53/cgi/php.ini ./

5. Add the lines to your .htaccess file:

Action php7.3-script /cgi-bin/php5.7.cgi

AddType php7.3-script .php

To manage PHP parameters in mod_cgi mode, add directives to the php.ini file. You can learn more about managing PHP parameters in mod_cgi and mod_php mode in this article.

If you have any questions, please create a ticket to technical support.