Page 1 of 1

PHP5 not working with my XAMPP installation

PostPosted: 22. February 2010 17:31
by markyoung1984
I have installed XAMPP version 1.7.3 on a Windows machine but cannot seem to get my PHP5 extensions working. If I go to a page http://localhost/contact.php everything displays fine but if I change the filename to contact.php5 and then try to browse to http://localhost/contact.php5 all I see is my code. My host requires me to specify the .php5 file extension

How can I overcome this?

Re: PHP5 not working with my XAMPP installation

PostPosted: 22. February 2010 18:09
by Wiedmann
but cannot seem to get my PHP5 extensions working.

\xampp\apache\conf\extra\httpd-xampp.conf
change (2 times):
Code: Select all
<FilesMatch "\.php$">

Code: Select all
<FilesMatch "\.(php|php5)$">


and:
Code: Select all
AddType text/html .php .phps

Code: Select all
AddType text/html .php .phps .php5


Restart Apache.

Re: PHP5 not working with my XAMPP installation

PostPosted: 23. February 2010 11:18
by markyoung1984
I tried what you said (all the variations) but I still get the same result. I am using virtual hosts as well. Could this have something to do with it?

I'm thinking the best thing to do at the moment is remove XAMPP completely, delete all related files and then reinstall XAMPP, see if it works and then implement the virtual hosts. Just installing XAMPP (without my additional virtual hosts) has worked in the past so this might be the best course of action. Unless you can suggest anything else.

Re: PHP5 not working with my XAMPP installation

PostPosted: 23. February 2010 11:45
by markyoung1984
Have just double checked my system (default XAMPP install) and I cannot run PHP5 on my system either. I was mistaken before. I looked into the apache\conf\extra in the httd-xampp.conf I see the following lines but it still does not work:

AddType text/html .php .phps .php5 .php4 .php3 .phtml .phpt
<FilesMatch "\.php$|\.php5$|\.php4$|\.php3$|\.phtml$|\.phpt$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

Re: PHP5 not working with my XAMPP installation

PostPosted: 23. February 2010 12:35
by Wiedmann
I tried what you said (all the variations)

What does you mean with "all the variation"?

Code: Select all
<FilesMatch "\.php$|\.php5$|\.php4$|\.php3$|\.phtml$|\.phpt$">

That's not what I have posted above...

Re: PHP5 not working with my XAMPP installation

PostPosted: 23. February 2010 16:33
by markyoung1984
In your original post above you mention a number of commands. I tried all the variations of them.

I have tried a clean install and added the code below. After restarting Apache I can still see my PHP code when loading a PHP5 webpage.

Code: Select all
<FilesMatch "\.php$|\.php5$|\.php4$|\.php3$|\.phtml$|\.phpt$"></FilesMatch>


The server would not start without me adding the </FilesMatch> at the end.

Re: PHP5 not working with my XAMPP installation

PostPosted: 23. February 2010 17:05
by Nobbie
markyoung1984 wrote:In your original post above you mention a number of commands. I tried all the variations of them.


No, you didn't. You're still blind, open your eyes and have a closer look the (original) command of "Wiedmann":

Code: Select all
<FilesMatch "\.(php|php5)$">


Now have a look to your (faulty) command:

Code: Select all
<FilesMatch "\.php$|\.php5$|\.php4$|\.php3$|\.phtml$|\.phpt$">


Don't you see the big(!) differences between your syntax and Wiemanns syntax?

What do you think about this one:

Code: Select all
<FilesMatch "\.(php|php5|php4|php3|phtml|phpt)$">

Re: PHP5 not working with my XAMPP installation

PostPosted: 24. February 2010 06:00
by Willy92
Is it really necessary to belittle people who ask for help -
You're still blind, open your eyes


It seems to be the standard from some peope here - If you don't want to help people who are new or lack understanding of the syntax - then don't post. When you put comments like that in you just make yourself look bad, and drive people away.

Re: PHP5 not working with my XAMPP installation

PostPosted: 06. August 2014 14:06
by mfarooqi
Wiedmann wrote:
but cannot seem to get my PHP5 extensions working.

\xampp\apache\conf\extra\httpd-xampp.conf
change (2 times):
Code: Select all
<FilesMatch "\.php$">

Code: Select all
<FilesMatch "\.(php|php5)$">


and:
Code: Select all
AddType text/html .php .phps

Code: Select all
AddType text/html .php .phps .php5


Restart Apache.


Thank you bro. .This worked.
I added one word ".php5" in httpd.conf

AddType application/x-httpd-php .php .phtml .php5


I've been fighting for about a month with my 3 computers (1. windows7, windows 8 and Macbook Pro)... 4 web servers WAMP, XAMPP on Windows, XAMPP on MAC, MAMP on MAC and lastly Mac's OWN apache.


aaah.. And finally a 4 digit word " .php5" solved the problem..

Really thank you sooo much..
:D :D :D :D :D