Jump to content

PHP CLI Parse Error


bhakti

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.