bhakti Posted December 30, 2010 Share Posted December 30, 2010 When I include a class in a file called from WinXP command line, I get this: Parse error: parse error in C:\Documents and Settings\Office\My Documents\xxx_system_files\apache\htdocs\php2010\gd_lib \col_proj_OO\Col_Magic.php on line 889 Line 889 is EOF I have read somewhere that single quotes cause a problem, but this is a big class with many uses of single quotes (strings assigned to vars and indices of arrays). The class works ok in web environment. Any suggestions how to debug this? Rgds B Link to comment https://forums.phpfreaks.com/topic/222999-php-cli-parse-error/ Share on other sites More sharing options...
BlueSkyIS Posted December 30, 2010 Share Posted December 30, 2010 is web environment linux or other non-windows? if so, it could be an issue of line-breaks used in the code (linux would use \n but Windows might expect \r\n). don't know for sure, i don't develop PHP on windows. Link to comment https://forums.phpfreaks.com/topic/222999-php-cli-parse-error/#findComment-1152996 Share on other sites More sharing options...
kenrbnsn Posted December 30, 2010 Share Posted December 30, 2010 Without seeing the code, it's hard for us to tell you what the problem is. Ken Link to comment https://forums.phpfreaks.com/topic/222999-php-cli-parse-error/#findComment-1153010 Share on other sites More sharing options...
bhakti Posted December 30, 2010 Author Share Posted December 30, 2010 OK guys! Through elimination, I removed a function containing open HTML spread over lines eg ?> <table border="1" cellspacing="2" cellpadding="2"> <tr> <td><? ...and I can imagine that CLI does not like what PHP is good at in a browser environment Im interested as to *why* this causes a problem though? Thank you for the suggestions. Rgds B Link to comment https://forums.phpfreaks.com/topic/222999-php-cli-parse-error/#findComment-1153050 Share on other sites More sharing options...
BlueSkyIS Posted December 30, 2010 Share Posted December 30, 2010 that parses for me. try using full php tags, <?php as that code should parse fine (assuming there are open and close php tags before and after), seeing the rest of the code might still be useful. still, if the same code works on linux but not windows, i still suspect a line-break problem. Link to comment https://forums.phpfreaks.com/topic/222999-php-cli-parse-error/#findComment-1153085 Share on other sites More sharing options...
bhakti Posted December 31, 2010 Author Share Posted December 31, 2010 It was the short PHP tags! Thank you! It needed <?php as you said. The class file did indeed have the full <?php, but not the inline php tags. Thank you all and Happy New Year! Rgds B Link to comment https://forums.phpfreaks.com/topic/222999-php-cli-parse-error/#findComment-1153322 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.