• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Plesk migration with outdated PHP versions

Manfred Beck

Basic Pleskian
I intend to migrate but have a couple of websites on the old machine running PHP 5.3.3, source and target machines have Plesk obsidian installed.

Will I have to face problems with the old PHP version?

In addition in some .htaccess files application-handler enables html files to be executable, which was a serious problem some time ago when switching to fast-cgi.

Any practical experience and recommendations will be highly appreciated!
 
On some operating systems like Debian 9, 10 and Ubuntu 18, 20 PHP 5.x is not available, only PHP 7.x is supported. On others like Red Hat Linux, CentOS older PHP versions can be used.

Issues with .htaccess configurations are not linked to the operating system or Plesk. To run .html file as PHP, several steps are necessary:
1) In .htaccess add this line:
Code:
AddHandler php-script .html .htm

2) Into the additional PHP directives in the PHP icon enter these two lines:
Code:
[php-fpm-pool-settings]
security.limit_extensions = .php .phar .html .htm .inc

3) If you are using the FAST-CGI PHP interface, you also need to add these lines into the Apache web server additional configuration directives section:
Code:
<IfModule mod_fcgid.c>
<Files ~ (\.htm$)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .htm
Options +ExecCGI
allow from all
</Files>
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.html$)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .html
Options +ExecCGI
allow from all
</Files>
</IfModule>

However, using PHP-FPM might be the better approach. It saves resources and is generally faster. If you choose the PHP-FPM interface, you need to add these directives into the Apache web server additional configuration instead:
Code:
<IfModule mod_proxy_fcgi.c>
<Files ~ .(?i:inc|html|htm)$>
SetHandler proxy:unix:///var/www/vhosts/system/example.com/php-fpm.sock|fcgi://127.0.0.1:9000
</Files>
</IfModule>
(replace "example.com" with your domain name)
 
Thank you very much for your reply.

I am migrating from CentOS 6.10 to 8.3, so PHP 5.3.3 hopefully should not be an issue, covered by "PHP from OS vendor" component I presume.

Then I don't have to change application handler entries in .htaccess files. The entries mentioned abouve were tested by me a couple of years ago and caused Awstats to "crash" but as far as I know this issue was fixed by plesk, so thumbs up ;-)
 
PHP 5.3 will not be available with CentOS 8.3
I think that using CloudLinux would be the only way to get PHP 5.3 in a somewhat "official" way.
If you stick with plain CentOS you will need to compile PHP 5.3 on your own.
 
On some operating systems like Debian 9, 10 and Ubuntu 18, 20 PHP 5.x is not available, only PHP 7.x is supported. On others like Red Hat Linux, CentOS older PHP versions can be used.

Issues with .htaccess configurations are not linked to the operating system or Plesk. To run .html file as PHP, several steps are necessary:
1) In .htaccess add this line:
Code:
AddHandler php-script .html .htm

2) Into the additional PHP directives in the PHP icon enter these two lines:
Code:
[php-fpm-pool-settings]
security.limit_extensions = .php .phar .html .htm .inc

3) If you are using the FAST-CGI PHP interface, you also need to add these lines into the Apache web server additional configuration directives section:
Code:
<IfModule mod_fcgid.c>
<Files ~ (\.htm$)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .htm
Options +ExecCGI
allow from all
</Files>
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.html$)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .html
Options +ExecCGI
allow from all
</Files>
</IfModule>

However, using PHP-FPM might be the better approach. It saves resources and is generally faster. If you choose the PHP-FPM interface, you need to add these directives into the Apache web server additional configuration instead:
Code:
<IfModule mod_proxy_fcgi.c>
<Files ~ .(?i:inc|html|htm)$>
SetHandler proxy:unix:///var/www/vhosts/system/example.com/php-fpm.sock|fcgi://127.0.0.1:9000
</Files>
</IfModule>
(replace "example.com" with your domain name)
Unfortunately I can only select PHP 7.4.14 powered by nginx, so html is not executable with this solution. Any suggestions?
 
You can only select "Nginx", because in the "Apache and Nginx settings" icon you have disabled "proxy mode", which means "Nginx only hosting". If you want to use Apache, you need to enable proxy mode, afterwards you can select PHP-FPM via Apache.
 
You can only select "Nginx", because in the "Apache and Nginx settings" icon you have disabled "proxy mode", which means "Nginx only hosting". If you want to use Apache, you need to enable proxy mode, afterwards you can select PHP-FPM via Apache.
sorry, too tired from migration, did not see the checkbox, now things should run smootly. Thx
 
Back
Top