$end err-PHP app on Windows, works fine on Linux

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

$end err-PHP app on Windows, works fine on Linux

Postby rfc1394 » 01. June 2010 02:33

I am using and making modifications to the open source calendar package iWebcal, written in PHP, which I downloaded from http://iwebcal.com. This application works perfectly on Apache with PHP 5.2 Linux. I checked and the PHP version I'm running as part of XAMPP on my Windows XP box is 5.3.1. So I went into my control panel for my Linux hosting and changed to PHP 5.3. No difference, it works perfectly.

When I try to run it as localhost on XAMPP I get the dreaded "$end not expected" error in calendar.inc (an included file), indicating PHP thinks the file is short. I say "dreaded" because it usually means a long tedious trek through the file looking for a missing brace, unclosed string or comment. But that doesn't make sense either, I should get the same error on PHP on Linux if there was a true code error.

The exact error message is "Parse error: syntax error, unexpected $end in C:\XAMPP\xampp\htdocs\iWebCal\class\Calendar.inc on line 1313"

Line 1313 of that file is, on my copy, the blank line after the ?> line.

I brought the program into a PHP-aware editor, Codelobster, which follows brace, HTML and comment placing, and it thinks the file is well formatted. So I'm stumped since it works perfectly on the Linux hosting I use but running it locally under Windows gives me a spurious file is short error.

So I thought maybe my changes did something (unlikely since it works flawlessly under Linux but I was curious). I went back to the .tgz archive, extracted the underlying main directory, renaming it, then moving that unchanged directory to htdocs so I can run it from localhost. iwebcal has no databases and requires no setup, you just run it. And the untouched, pristine original source gets the same $end error, albeit on line 1168.

Since it runs "out of the box" (or rather, out of the archive) on Linux hosting I'm thinking the way Windows is doing something is causing a problem.

Any help in trying to find what is wrong or where to look would be appreciated.

Paul Robinson
"The lessons of history teach us - if they teach us anything - that no one learns the lessons that history teaches us."
Posts: 2
Joined: 01. June 2010 02:00

Re: $end err-PHP app on Windows, works fine on Linux

Postby tvelter » 22. March 2011 08:55


I faced a similar problem and after investigating I found that Windows Xampp is less flexible than its Linux counterpart.

For your problem, I think it might be related from the way php code is invoking HTML code. Example on line 434 to 437 :
Code: Select all
echo "</p>";
<table cellspacing="1" cellpadding="6" bgcolor="#999999">

Try to not close and reopen php code, and use only
Code: Select all
echo "";
from within php.....
Posts: 1
Joined: 22. March 2011 08:48

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 37 guests