/    Sign up×
Community /Pin to ProfileBookmark

Error messages to Browser

I’m on day 4 of my entry into PHP. I’m very conversant with Perl so programming is not new.
I’m getting periodic errors in my code and would like to show ALL error and warning messages on the Browser

Seaching the web I found this which seems to show most errors

[code]
<?php
error_reporting(E_ALL);
ini_set(“display_errors”, 1);


[/code]

but…

[code]

$msg = ‘This is a block of multi-line text that I parse into a ‘.
‘templating script. But if I end the line with a comma ‘, // Note the comma
‘instead of a period the script returns a completely blank ‘.
‘screen’.”n”;
echo $msg;

[/code]

Is there some means of detecting this type of error? I do not have root access to the server.
Sometimes it can be really hard to find.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiAug 07.2010 — It's just a simple parse error so it should be showing - I assume your error_reporting lines are before the broken code? It could be that your host has ini_set disabled, but then you say you are getting some errors?

btw to show all errors you actually need:

[code=php]error_reporting(E_ALL | E_STRICT);
ini_set("display_errors", 1);
[/code]


Edit: doh it's too early for my brain to be working! The parse error will prevent the above lines from being run as parse errors break the entire script. Do you have access to .htaccess files? If so you can set these values there:

php_value display_errors On
php_value error_reporting E_ALL | E_STRICT
×

Success!

Help @Nedals spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...