"Parse error: parse error"
Moderator: General Moderators
-
sheppardzwc
- Forum Newbie
- Posts: 20
- Joined: Mon Aug 17, 2009 3:04 pm
"Parse error: parse error"
All of my PHP errors are coming up as
"Parse error: parse error in ____ on line ___"
How can I make them more descriptive (display the actual error)? I'm running Apache2.2/PHP5.3 on Windows Vista localhost.
"Parse error: parse error in ____ on line ___"
How can I make them more descriptive (display the actual error)? I'm running Apache2.2/PHP5.3 on Windows Vista localhost.
Re: "Parse error: parse error"
I'm afraid that's about as descriptive as PHP error messages usually get. You can make sure that your error level is set as high as possible, but that's about it. If it's a parse error, it should be pretty clear what's wrong when it points you to the specific line (although the actual error is often a line or two earlier, but doesn't create an error until it has gone on to the next line). See http://www.addedbytes.com/php/php-ini-g ... d-logging/
also http://www.linuxquestions.org/questions ... ..-433706/
also http://www.linuxquestions.org/questions ... ..-433706/
Re: "Parse error: parse error"
I think PHP error messages are amazingly helpful compared to other languages'.
-
sheppardzwc
- Forum Newbie
- Posts: 20
- Joined: Mon Aug 17, 2009 3:04 pm
Re: "Parse error: parse error"
Well, like this here.
My server:

vs.
A friend's dedicated linux: http://ariact.org/forum/includes/functions.sql.php
My server:

vs.
A friend's dedicated linux: http://ariact.org/forum/includes/functions.sql.php
Re: "Parse error: parse error"
Oh right...I see what you mean.
Do you have error messages turned on in php.ini?
And lol...that guy has a parse error in like every script....
Do you have error messages turned on in php.ini?
And lol...that guy has a parse error in like every script....
-
sheppardzwc
- Forum Newbie
- Posts: 20
- Joined: Mon Aug 17, 2009 3:04 pm
Re: "Parse error: parse error"
Never said I was a GOOD coder. rofl.jackpf wrote:Oh right...I see what you mean.
Do you have error messages turned on in php.ini?
And lol...that guy has a parse error in like every script....
Code: Select all
; Common Values:
; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.)
; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices)
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_NOTICE
; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; It's recommended that errors be logged on production servers rather than
; having the errors sent to STDOUT.
; Possible Values:
; Off = Do not display any errors
; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
; On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On
; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
; errors from clients. Turning the display of startup errors on can be useful in
; debugging configuration problems. But, it's strongly recommended that you
; leave this setting off on production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/display-startup-errors
display_startup_errors = OnRe: "Parse error: parse error"
by the way, it's best to work with STRICT while developing
Check your apache error log, you might see something relevant in there.E_ALL | E_STRICT
-
sheppardzwc
- Forum Newbie
- Posts: 20
- Joined: Mon Aug 17, 2009 3:04 pm
Re: "Parse error: parse error"
My apache error log details the actual error, just doesn't display it on the page.
[Mon Aug 17 23:17:15 2009] [error] [client 127.0.0.1] PHP Parse error: parse error, expecting `')'' in C:\\forum\\includes\\config.php on line 14, referer: http://server/includes/
And it displays fatal errors. Like foo().
Fatal error: Call to undefined function foo() in C:\forum\foo.php on line 3
But what about parse errors?
[Mon Aug 17 23:17:15 2009] [error] [client 127.0.0.1] PHP Parse error: parse error, expecting `')'' in C:\\forum\\includes\\config.php on line 14, referer: http://server/includes/
And it displays fatal errors. Like foo().
Fatal error: Call to undefined function foo() in C:\forum\foo.php on line 3
But what about parse errors?
Re: "Parse error: parse error"
Stuff like this:
Will just say "parse error on line...". It does that for me as well.
Code: Select all
<?php
$var = 'foo'
$var2 = 'something else'
//notice no semi-colonsRe: "Parse error: parse error"
It saysjackpf wrote:Will just say "parse error on line...". It does that for me as well.
Code: Select all
Parse error: syntax error, unexpected T_VARIABLE in /home/weirdan/q.php on line 3
Re: "Parse error: parse error"
what OS, apache version and PHP version are you running?
Re: "Parse error: parse error"
Oh right...I thought that was normal.
I'm on Windows XP, Apache 2.2, PHP 5.3.
How odd.
I'm on Windows XP, Apache 2.2, PHP 5.3.
How odd.