Administrator
- Join Date:
- Sep 2009
- Location:
- Stuart, FL
- Posts:
- 14,110
- Plugin Contributions:
- 56
Corrections for obscure "syntax error, unexpected end of file" errors
This one had me pulling my hair out for a while. I've got a localhost installation of my hosted website; upgraded both to PHP version 5.4. All's going well, then I noticed that one of my pages went blank on my localhost version with the "syntax error, unexpected end of file" error in the debug*.log file. When I checked my hosted version, all's fine. The only difference appears to be that the localhost installation is running on Windows and my hosted version is running on linux.
After much probing and prodding, the errant line was the one highlighted in red:
<?php/*-bof-c-minacct
<?php if (!$flagDisablePaymentAddressChange) { ?>
*/ ?>
The fix was to add a space between the <?php and the /*!
<?php /*-bof-c-minacct
<?php if (!$flagDisablePaymentAddressChange) { ?>
*/ ?>
I'll be updating my "Minimum Customer Account Information" to make this change, but thought that others might be interested as well. Note that this code ran fine on my previous XAMPP installation using PHP 5.2.17, so a change must have been introduced in the interim that affects Windows.
Update: I'm also updating all my changes to make sure that there is not only a space after each <?php but also a space before each ?>.