not excecuting code with .php5 extension? why?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
tvs008
Forum Commoner
Posts: 29
Joined: Wed May 03, 2006 10:46 pm
Location: Seattle

not excecuting code with .php5 extension? why?

Post by tvs008 »

I'm moving a website to a diff host and all the files have a .php5 extension. I've never encountered this and I'm having trouble finding info on it (searching ".php5" just returns results for php5...).

The old host was php 5, and, yes, the new host is php 5. I don't have access to the .config file, so I'm wondering if this has to do with .htaccess and apache?

How do I get files with .php5 to excecute?

Thanks in advance
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

It depends on the provider's webserver configuration.
With apache and php installed as module you can assign file extensions to be handled by the php module e.g. with

Code: Select all

AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml
AddType <mime-type> extensions
Maybe your provider doesn't grant you access to a config file where you can change this mapping.
Maybe your provider doesn't run php as a webserver module.
Maybe your provider doesn't use apache as webserver.
You really should ask your provider ;)
User avatar
tvs008
Forum Commoner
Posts: 29
Joined: Wed May 03, 2006 10:46 pm
Location: Seattle

Post by tvs008 »

high five!

that worked. i thought they would have that by default, sheesh, i asked their support and he said , well, he said the browser wouldnt read it, which i guess is <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> as long as the browser gets its html, eh?

so, out of curiosity, is there a difference to the engine if its .php or php5, as long as it can read it?

thanks again
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

php doesn't care about the name of the scriptfile. It's only the webserver that has to know what files it has to pass to what handler (php,perl,ssi, ...).
So the answer is "no, .php or .php5 doesn't matter"
User avatar
tvs008
Forum Commoner
Posts: 29
Joined: Wed May 03, 2006 10:46 pm
Location: Seattle

Post by tvs008 »

ahhh, thats great info. a nice little lesson for someone like me who hasn't set up a webserver. i never really understand the order of operation between apache and a php engine... the http request goes through apache, apache gets the file and decides if it should run through php first the back out through apache? i dunno, ill look that up... but thanks for your help!
Post Reply