/    Sign up×
Community /Pin to ProfileBookmark

Where are the error messages!!

Hi guys.

I started messing around with php a year or so ago but didnt get far as other things cropped up. I have just started trying to learn again and have installed the latest version of php, MySQL and Apache. The installation appears ok so far. My question is this. Where have all the error messages gone. On the last version of php if i had missed a semi colon etc then i would have been given notification of this. However this doesnt appear to happen now and I have been left looking at a blank screen. Looking at some posts I get the impression that this is the default behaviour and I need to alter the php.in file. I would be grateful if someone could confirm this. I have found the following piece in the php.ini file.

; – display_errors = Off [Security]
; With this directive set to off, errors that occur during the execution of
; scripts will no longer be displayed as a part of the script output, and thus,
; will no longer be exposed to remote users. With some errors, the error message
; content may expose information about your script, web server, or database
; server that may be exploitable for hacking. Production sites should have this
; directive set to off.

If i change the -display_errors = Off to -display_errors = On
will this solve the problem??

Thanks

Dave

Oh and just another quick question if anyone can answer. I am going through some examples in a book and it suggests using;
$name = $HTTP_POST_VARS[‘name’]; to create short variable names.
However this doesnt appear to work so I have been using
$name = $_POST[‘name’]; is this correct??

Double Thanks ?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 25.2006 — Either activate display_errors (which is no big deal if your just working on your PC and not worried about outsiders seeing error messages), or activate log_errors and specify a log file for the error_log option. Once the desired log option is specified, at least while developing a script, you might want to start it off with <?php error_reporting(E_ALL) ?> to make sure all messages are reported.

As far as your book's sample, it's either out-of-date or not well-written. $_POST is now the preferred method of accessing post values.
Copy linkTweet thisAlerts:
@bjoerndalenauthorFeb 25.2006 — Hi there NogDog and thanks for the quick reply.

Yeah I just intend to use this on my pc here at home and just wondered where the messages had gone.

Mmmmm...just had a look and it must have been a bit more than a year since I messed around. The book I'm using refers to PHP v4.3 and was published in 2003.

I guess I may need a new book. Ha hahaha...

I don't suppose you could recommend one?

Again Thanks for the response and I will alter the Off to On.

Dave. ?
Copy linkTweet thisAlerts:
@NogDogFeb 25.2006 — Hmm...by PHP4.3 $_POST was already the preferred mode. Sounds like it just wasn't really up-to-date. The only "book" I really use is http://www.php.net/manual/en/ (I borrowed one or two other books from a guy at work when I first started working with PHP, but now I just use the php.net site).
Copy linkTweet thisAlerts:
@bjoerndalenauthorFeb 25.2006 — Thanks..

I've just had a look and although it uses that method. Which it calls " long style " it does make a note that " it is deprecated and is therefore likely to be removed in the long term".

I have a feeling i'll be on here quite a bit in the future.

Again thanks.

Dave. ?
×

Success!

Help @bjoerndalen 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.6,
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,
)...