Multiple versions of php installed, set .php default?

admin

Administrator
Staff member
Hey people,

My server has both php4 and php5 installed. The default to execute when opening a .php file is php4. To get php5 I need to manually rename files to php5.

How can I get .php files to run as .php5 without having to rename them? (without changing the server settings, as I'm unable to do that).

I did manage to do such a thing before, getting .html files to execute as .php (so I could do file.html?var=value kinda thing).. that's a similar thing I guess. When I did it before, it was by putting a file in the server directory.. telling it what to execute as what.. but I can't seem to work out how to do it again.

Can anyone help?

Cheers very much!Your webserver controls how pages are processed. Unless you can change Apache (or whatever) to handle .php as PHP5 by default, I don't know another way to do it.

(To qualify this, I am much more a PHP guy than a sysadmin. So, there may be a way to do it, but it's outside of the scope that I know).You could try ModRewrite to rewrite any .php to .php5Isn't that part of the server configuration file?Isn't that part of the server configuration file?

Doesn't have to be. If the server has Allow Override set you can override settings using .htaccess file.Then I stand corrected. I'll stop poking my nose into the sysadmin stuff unless I know what I'm talking about.If you know C then you can add a little module to Apache to allow you to do that with one click. But considering you are asking this question, you probably don't know C...

Yeah I would go with the mod_rewrite as it is the best way I can think of at the moment...there's probably an easier way to do it though.
 
Back
Top