Apologies if this is a simple fix - total newbie to servers. Have moved numerous sites across from another host (became unreliable) to my new VPS. Everything is running apart from one site which the person designed with all the php files ending in .php4 . The index page is html which links to the rest of the site which are files ending .php4. These files download in the browser instead of displaying. The VPS has php5 installed but renaming the file to .php and the file displays just fine. So is there an easy way to associate .php4 files as ordinary .php files or am i going to have to go through every page of the site renaming all the links / urls to .php ? I have googled this and had a try at adding stuff to httpd.conf and php.ini from the virtuozzo panel (affects the whole vps), have also tried placing .htaccess file in the webspace of the individual website giving bother with various things like AddType /x-httpd-php .php .php4 to no avail. any help appreciated.
In your Apache configuration look for the place where the .php extensions are setup. It should look like this: AddType application/x-httpd-php .php right after that add a line like this: AddType application/x-httpd-php .php4 Reload or Restart apache. Now your.php4 files should be working as well.
That line seems to already be in place in apache2.conf - is that the right place to be looking? httpd.conf is a blank file and have tried adding it to there too.
That sounds like the right place (its different for every OS). Are there any <IfModule> Directives around those lines that could prevent them from being active?
It is exactly for these type of cases that arise that I should ask an expert instead of doing a "Do It Yourself" approach
seems putting said line into .htaccess in root folder of website concerned has sorted it out atleast for that particular webspace on the vps