• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Resolved .php4 Extension gets download php-file not executed by apache

Peter Kleemann

New Pleskian
Hi,

I have old php-Files with the extension .php4 migrated to my new web host, which is running under Ubuntu 14.04.5 LTS, Plesk Onyx Version 17.0.17. If I call a script (example phptest.php4) with the webbrowser, it will offer me the sourcecode for download. Apache is running with php5.6.30 as FPM - tried FastCGI too.

I DON'T WANT to install php4, I want to run them under php5 - which is installed and the scripts are working fine, when I rename the file to .php - but thats not the solution, because there are many, many inlcudes, links, google-rankings etc. with the .php4 extension.

I tried to add a handler in the plex/domain/apache & nginx settings. I tried alternative extensions for testing:

"php-script .script" -> file renamed to phptest.script, working
"php-script .blafasel" -> file renamed to phptest.blafasel, working
"php-script .php4" -> file renamed to phptest.php4 .... script will fully offered to download.

Looks like inconsistent and confusing behavior.

I searched forums, tried .htaccess-Solutions (AddHandler, AddType etc.), tried modification with /var/www/vhost/system/domain/conf/vhost.conf, AddHandler/AddType in apache2.conf, services restarted, server restarted, but that made no effect.

So, where is my mistake? Can someone help?

Thank you in advance,
Peter
 
Hi,

because no one seems to have an answer, and I hit the same problem with .pl extension in /cgi-Director, I used the hard way via mod_rewrite and .htaccess:

RewriteEngine On
RewriteRule (.*)\.php4$ $1.php


That is nothing more than a workaround and far away from a solution, but it works.

Please feel free to add a real solution :D

Peter
 
Back
Top