Page 1 of 1

XAMPP and PHP on Windows 7

PostPosted: 03. January 2010 03:24
by Lennart
I have successfully installed XAMPP 1.7.3 on Windows 7 Ultimate edition. I am running as an administrative user an I have installed XAMPP in c:\xampp.

XAMPP comes up fine and the PHP samples run fine. I can also write small PHP test programs that work.

Howewer, when I try to run a larger program that I have run on Windows XP SP2 for the last two years i get a parsing error:

Code: Select all
<p>
<form method="post" action="<?php echo $PHP_SELF;?>">
<?
$b= new Busa();
$b->displayTypes("USA");
?>
     
<p><input type="submit" name="SubmitForm" value="Sortera">
</form>


The code snippet above results in the following parsing error:
displayTypes("USA"); ?>

and then the rest of the php code is displayed without being interpreted, just like when you run a PHP file in an HTML page without php enabled. I.e. the PHP parser does not understand $b->displayTypes("USA"); and the rest of the page

Now, as I said, this runs fine without any problem on a number of Windows XP servers I have. I have made NO CHANGES to my own code, just copied it over. First file by file then by zipping it up and unzipping it on Windows 7.

AND, to make things even more mysterious, since I thought there might be a problem with XAMPP, I installed one of your competitors and I get EXCACTLY the same error.

So this has something to do with Windows 7 but I can't for the life of me figure out what it is. And I can add that Windows 7 Ultimate was installed by an expert, so it works fine.

Since I am sure I am not the only one who will encounter this problem I wonder if anyone else has seen this and can help me figure out what is causing it.

It is really odd.

Re: XAMPP and PHP on Windows 7

PostPosted: 03. January 2010 03:30
by Wiedmann
Code: Select all
<form method="post" action="<?php echo $PHP_SELF;?>">

Code: Select all
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">


Code: Select all
<?

Code: Select all
<?php

Re: XAMPP and PHP on Windows 7

PostPosted: 03. January 2010 19:09
by Lennart
Whao, that was it, MANY THANX for your response! The odd thing is that the code I had before the changes works fine on an earlier version of XAMPP on Windows XP. Thanx again!