Using FastCGI + OPcache (deprecated)
To properly enable FastCGI+OPcache, in the instructions below, you need to replace:
For accounts with FastCGI support, you can enable the technology for your main website (www.domain.com) in three simple steps: Step 1)Create the /home/USERNAME/www/www/.ht-fcgi-php-wrapper file through the "File Manager" section in your hosting Control Panel. Please make sure the file has executable permissions (we recommend that you set its permissions to 775). The file should contain the following code: #!/bin/bash Note: If the /home/USERNAME/www/www/php.ini file does not exist, you should create it using the hosting Control Panel -> "File Manager" section and add the default content of php.ini files on our servers to it for compatibility reasons. In this first step, it is important to note that you choose the PHP version on which the code will be running by specifying the path to the CGI script (i.e. php74.cgi). This is done in the last line of the above-mentioned piece of code. You can choose from the following options, depending on the preferred PHP version: PHP 8.2: exec /usr/local/bin/php82.cgi -c /home/USERNAME/www/www/php.ini PHP 8.1 (recommended): exec /usr/local/bin/php81.cgi -c /home/USERNAME/www/www/php.ini PHP 8.0: exec /usr/local/bin/php80.cgi -c /home/USERNAME/www/www/php.ini PHP 7.4: exec /usr/local/bin/php74.cgi -c /home/USERNAME/www/www/php.ini PHP 7.3 (obsolete): exec /usr/local/bin/php73.cgi -c /home/USERNAME/www/www/php.ini PHP 7.2 (obsolete): exec /usr/local/bin/php72.cgi -c /home/USERNAME/www/www/php.ini PHP 7.1 (obsolete): exec /usr/local/bin/php71.cgi -c /home/USERNAME/www/www/php.ini PHP 5.6 (obsolete): exec /usr/local/bin/php56.cgi -c /home/USERNAME/www/www/php.ini PHP 5.3 (obsolete): exec /usr/local/bin/php53.cgi -c /home/USERNAME/www/www/php.ini Note: Make sure to replace USERNAME with your hosting account username, which is listed under the information panel in the upper left corner of your hosting Control Panel. Step 2)Create an /home/USERNAME/www/www/.htaccess file and add the following code to it, or add the code to your existing .htaccess file: <IfModule mod_fcgid.c> Note: Make sure to replace USERNAME with your hosting account username, which is listed under the information panel in the upper left corner of your hosting Control Panel. Also, check your .htaccess file for other AddHandler directives and comment/delete them. Step 3)Enable OPcache by adding the following piece of code to the main php.ini file for your website via the "PHP Settings" section in your hosting Control Panel: ;Enabling OPcache
Note: If you want to enable FastCGI for a subdomain (example.domain.com), you need to create the /home/USERNAME/www/example/.ht-fcgi-php-wrapper file, update the last line in it to use the subdomain's php.ini file (e.g. /home/USERNAME/www/example/php.ini), and create or edit the file /home/USERNAME/www/example/.htaccess. The path to .ht-fcgi-php-wrapper specified in your .htaccess file should also be correct. In case you are experiencing any difficulties with FastCGI, you can contact our support team for assistance. |