In my experience, running PHP 4.3.x on IIS 5.0, when I have an error that happens before the displayed error, the problem is usually a missing } or something similar. That line that is displayed as causing the error (118) is usually the last line of PHP code in that document. It was triggered as the error line because PHP was still looking for that closing bracket or whatever when the page ended.
I've also noticed that when I have a problem in an include/require file, PHP tells me that the error is in that file, not the main php document. With all that being said, I'm sure that there have been exceptions to this rule that I didn't notice. I know that 99% of the time there is an error, I can simply go to that line specified by PHP and find the problem. Conor -----Original Message----- From: Riquez [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 1:36 PM To: [email protected] Subject: [php-list] Re: 'nice' error msgs - how? On 21 May 2004, at 18:45, Riquez wrote: > --- "Parse error: parse error in /script.php on line 29" --- > Line 29 is never the 'right' line as i think php skips comments & line > breaks etc > Is there some way to make these errors report the right line? Can you help? I wrote in with this request for help some time back, but I'm still having problems. I use Apache + PHP 5 on Mac OS X Today I noticed a parse error quoted as line 118. The 'actual' error was on line 24. It seems that PHP is counting the lines of require() files too. At work we use a Win 2003 server + PHP 5, it always accurately reports the line number. Any ideas why I get wildly out-of-sync parse error line numbers? What can I do to fix it? Thanks, Riquez Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
