Create a "php#_wrapper.sh" script in your top level fcgi-bin directory.
Replace the # in the php#_wrapper.sh filename with your PHP version number. Add the the following line in your new script:
#!/bin/sh
exec /usr/www/cgi-bin/php#.cgi
Replace the # in php#.cgi with the PHP version number. For example, php8.cgi or php7.cgi. You'll need to make the script executable with the following command:
chmod 700 $HOME/public_html/fcgi-bin/php#_wrapper.sh
The php#_wrapper.sh in this command should match the name of the php#_wrapper.sh file you created in Step 1.
Create an ".htaccess" file in the directory where your PHP files reside, and add these lines:
AddType application/x-httpd-php# .php
Action application/x-httpd-php# /fcgi-bin/php#_wrapper.sh
Replace the # with your PHP version number.
Make sure the php#_wrapper.sh matches the name of the file you created in Step 1.
Examples:
AddType application/x-httpd-php8 .php
Action application/x-httpd-php8 /fcgi-bin/php8_wrapper.sh
AddType application/x-httpd-php7 .php
Action application/x-httpd-php7 /fcgi-bin/php7_wrapper.sh