Jump to content

how can I get PHP displays parsing error and line number


hvle

Recommended Posts

I know I got syntax error some where.  But php simply say "Errors parsing esearch.php".  It does not display line number or any kind of hint.  I've also set the error reporting to display all error and E_PARSE in ph.ini

 

I am using php 5.2 and command line to run.

 

Thanks

Link to comment
Share on other sites

The thing that troubled me is the parsing error, not run-time error.  The error occurs when php see a php code that it doesn't like.

 

try to run a code like this

<?php
for ($i=1;$i<5; $i++)
{
  $i = 6
}
?>

 

Note there is no semicolon after 6.  When running this script, I got absolutely error message.

except for "parsing error".

 

Link to comment
Share on other sites

Oh I agree it should produce an error. Interestingly enough I've never used PHP as just a scripting language from the command line. I've only used it for web stuff. In theory I guess it should be the same. Hrmmm.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.