PDA

View Full Version : i need my browser tell me which line is wrong but this doesnt happen in my browser. my file is index


mampwamp
08-17-2010, 02:58 AM
why my browser cant print out the parse error alert message to show which line is wrong? it directly open in blank page without any alert message.

i try to instead a wrong apostrophe (') to quotation marks (") for the last "print out this word" sentences but my browser open in blank page.


<?php

$var1="print out this word';
print $var1;
?>



if i write correct php coding, my browser will show the result.

<?php

$var1="print out this word';
print $var1;
?>




i need my browser tell me which line is wrong but this doesnt happen in my browser. my file is index.php. what is going on ?

i am using mamp on mac.

davidj
08-17-2010, 08:25 AM
check your PHP.ini file

look for the error handling section of the file

what parameter is set?

mampwamp
08-17-2010, 10:35 AM
i think my computer havent install php yet.

which file should i to download. i am using machintosh mac computer.
http://www.php.net/downloads.php

davidj
08-17-2010, 11:21 AM
if i write correct php coding, my browser will show the result.

You said that PHP works as you are outputting results???

mampwamp
08-17-2010, 12:39 PM
the php is works for me. i can write php and test in my localhost. the problem is if i write some wrong php, my browser wouldnt tell me will line is wrong, it only show me blank page. if i write the right php coding, my browser will show me the result.

davidj
08-17-2010, 01:15 PM
As above

check your PHP.ini file

look for the error handling section of the file

what parameter is set?

mampwamp
08-17-2010, 11:21 PM
how to check php.ini ?

gentleone
08-18-2010, 01:28 AM
how to check php.ini ?

I can open/edit php.ini files on my Mac with TextEdit, but I'm not sure if this can be done on the PC with Notepad.

edbr
08-18-2010, 01:34 AM
yes u can but notepad++ is worth downloading

DWcourse
08-18-2010, 05:02 AM
on a mac, bbedit is a good choice.

mampwamp
08-18-2010, 11:32 PM
I can open/edit php.ini files on my Mac with TextEdit, but I'm not sure if this can be done on the PC with Notepad.

where is the file location for php.ini ?

edbr
08-19-2010, 01:21 AM
in the php directory

mampwamp
08-20-2010, 03:16 AM
ok. thank.

mampwamp
08-20-2010, 04:44 AM
in the php directory

the location is in my /Applications/MAMP/conf/php5/php.ini

how i check what is the problem is ??

i upload my php.ini to this server, please take a look for this file.
http://www.mediafire.com/?5r1713d2m968p3m

edbr
08-20-2010, 05:06 AM
look for the error handling section of the file

what parameter is set?
davidj's original question

edbr
08-20-2010, 05:09 AM
look for a section like this


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field. Or each number up to get desired error
; reporting level
; E_ALL - All errors and warnings (doesn't include E_STRICT)
; E_ERROR - fatal run-time errors
; E_RECOVERABLE_ERROR - almost fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_STRICT - run-time notices, enable to have PHP suggest changes
; to your code which will ensure the best interoperability
; and forward compatibility of your code
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
;
; Examples:
;
; - Show all errors, except for notices and coding standards warnings
;
;error_reporting = E_ALL & ~E_NOTICE
;

mampwamp
08-20-2010, 05:59 AM
look for a section like this


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


i found from the internet it say need configure the following section.
error_reporting = E_ALL
display_errors = On
log_errors = Off

i have change display_errors to On and log errors to Off regarding to the setting above.
but not sure with the error_reporting how to set to E_ALL.


can you tell me which line of the error_reporting setting to E_ALL

mampwamp
08-20-2010, 06:31 AM
hi..problem settle..
just turn on display_errors and restart mamp.

davidj
08-20-2010, 10:01 AM
excellent

got there in the end