Problems with XAMPP PHP parsing

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Problems with XAMPP PHP parsing

Postby malatang » 14. March 2009 02:32

Hello,

I have installed XAMPP 1.7 on a windows vista machine and the install went fine however when I open a php file in my browser it just displays the code. I have been researching the inernet trying to find out why, but have had no such luck.

I have tried adding

LoadModule php5_module "c:/xampp/php/php5apache2_2.dll"
AddType application/x-httpd-php .php .phtml
PHPIniDir "c:/xampp/php"

to the apache httpd.conf file with no luck.

Can someone please help me with this or if this has been covered already please point me to the thread. ( I tried the search function for this forum with no luck)

Thanks alot
malatang
 
Posts: 4
Joined: 14. March 2009 02:17

Re: Problems with XAMPP PHP parsing

Postby Izzy » 14. March 2009 02:39

malatang wrote:when I open a php file in my browser
How are you calling the php file - what address in the browser?
malatang wrote:I have tried adding

LoadModule php5_module "c:/xampp/php/php5apache2_2.dll"
AddType application/x-httpd-php .php .phtml
PHPIniDir "c:/xampp/php"

to the apache httpd.conf file with no luck.
Remove these additions as they will give errors and revert your httpd.conf file to the defaults in place after you installed.

BTW the php.ini folder in XAMPP is C:\xampp\apache\bin
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Problems with XAMPP PHP parsing

Postby malatang » 14. March 2009 02:46

Izzy wrote:How are you calling the php file - what address in the browser?


http://localhost/mysqltest.php

Remove these additions as they will give errors and revert your httpd.conf file to the defaults in place after you installed.

I removed them.
malatang
 
Posts: 4
Joined: 14. March 2009 02:17

Re: Problems with XAMPP PHP parsing

Postby Izzy » 14. March 2009 03:04

malatang wrote:http://localhost/mysqltest.php
Whare is this file located in your XAMPP installation?

Can you go to http://localhost and see the XAMPP Welcome page?

Can you run http://localhost/xampp/phpinfo.php and what do you see?

malatang wrote:I removed them.
Did you restart Apache after editing the httpd.conf file?

Search your PC for any other php.ini files and either rename them or delete them except the one in the xampp\apache\bin folder and any in your XAMPP installation folder, then restart Apache and try again.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Problems with XAMPP PHP parsing

Postby malatang » 14. March 2009 03:33

Izzy wrote:Whare is this file located in your XAMPP installation?


C:\XAMPP\htdocs\mysqltest.php

Izzy wrote:Can you go to http://localhost and see the XAMPP Welcome page?


Yes, I get the welcome page

Izzy wrote:Can you run http://localhost/xampp/phpinfo.php and what do you see?


I get the PHP page that show the version and all the other info.

Izzy wrote:Did you restart Apache after editing the httpd.conf file?

Search your PC for any other php.ini files and either rename them or delete them except the one in the xampp\apache\bin folder and any in your XAMPP installation folder, then restart Apache and try again.


I searched the computer and found no other php.ini files. I uninstalled xampp, restarted the computer, re-installed xammp, placed the mysqltest.php back into

C:\XAMPP\htdocs\ and got the same thing again.
malatang
 
Posts: 4
Joined: 14. March 2009 02:17

Re: Problems with XAMPP PHP parsing

Postby Izzy » 14. March 2009 03:55

malatang wrote:C:\XAMPP\htdocs\mysqltest.php

Yes, I get the welcome page

I get the PHP page that show the version and all the other info.

I searched the computer and found no other php.ini files. I uninstalled xampp, restarted the computer, re-installed xammp, placed the mysqltest.php back into

C:\XAMPP\htdocs\ and got the same thing again.
Then your issue is related only to the file mysqltest.php because the links I gave are all php files and they work without issue.

Paste the file here or check the code again and make sure that when editing the file that you save it as text only not with any other encoding like utf-8 or you may add a line at the very top (BOM - Byte Order Mark) that is invisible and will prevent the php file from being parsed by the server.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Problems with XAMPP PHP parsing

Postby malatang » 14. March 2009 04:07

I figured out my problem. It was my own stupidity, I had <$php instead of <?php. I looked at that file about 50 times in the last two days and never saw it. Then I got it in my head that it was a problem with xampp so I kept looking for reasons why. :?

Thank you so much for your help and i'm sorry for wasting your time. :oops:

Thanks again.
malatang
 
Posts: 4
Joined: 14. March 2009 02:17

Re: Problems with XAMPP PHP parsing

Postby Izzy » 14. March 2009 04:12

No problem and your welcome.

Now enjoy your XAMPP experience and good luck.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 119 guests