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.
"The lessons of history teach us - if they teach us anything - that no one learns the lessons that history teaches us."