473,322 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Syntax error handling

When I run a PHP script on my server that contains a syntax error, it
gives me no information on the error; no error handling or anything
just returns this blank page:
<html><head></head><body></body></html>
always on one line like that. It's always done that. I have a Linux
server. I've never changed any of the php.ini stuff. So unless my
hosting company changed it, it should all be set to default values.
Does anyone have any idea how I could get it to display a line number
for syntax errors?

Jul 17 '05 #1
4 1668
DJ Craig wrote:
When I run a PHP script on my server that contains a syntax error, it
gives me no information on the error; no error handling or anything
just returns this blank page:
<html><head></head><body></body></html>
always on one line like that. It's always done that. I have a Linux
server. I've never changed any of the php.ini stuff. So unless my
hosting company changed it, it should all be set to default values.
Does anyone have any idea how I could get it to display a line number
for syntax errors?


error_reporting(E_ALL);

C.
Jul 17 '05 #2
DJ Craig wrote:
When I run a PHP script on my server that contains a syntax error, it
gives me no information on the error; no error handling or anything
just returns this blank page:
<html><head></head><body></body></html>
always on one line like that. It's always done that. I have a Linux
server. I've never changed any of the php.ini stuff. So unless my
hosting company changed it, it should all be set to default values.
Does anyone have any idea how I could get it to display a line number
for syntax errors?


Hi,

Check:
http://nl2.php.net/manual/en/ini.php

and lookup: error_reporting

You can change that to your errorreportinglevel of choice.
Even if the php.ini is changed, you can overrule this.

Regards,
Erwin Moller
Jul 17 '05 #3
error_reporting(E_ALL);
do you just put that command at the beginning of the source code for
the program where you want syntax error handling?

I do have permissions to modify my server's php.ini file.

Jul 17 '05 #4
DJ Craig wrote:
error_reporting(E_ALL);
do you just put that command at the beginning of the source code for
the program where you want syntax error handling?

I do have permissions to modify my server's php.ini file.


Do you?
That makes things easy.

In that case I suggest you find in php.ini: error_reporting

set it to:
error_reporting = E_ALL

(Maybe you should restart your webserver after that. Not sure.)

Regards,
Erwin Moller
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Charon | last post by:
I see two colons in the middle of what look like method calls here and there. Such as when using PEAR // implement pear db object $this->_oConn =& DB::connect(DSN); I have looked all over...
2
by: WSeeger | last post by:
When creating a new class, is it encouraged to always include error handling routines within your LET and GET procedures? It's seems that most text books never seem to include much about error...
5
by: S.Patten | last post by:
Hi, I have a problem with updating a datetime column, When I try to change the Column from VB I get "Incorrect syntax near '942'" returned from '942' is the unique key column value ...
23
by: Carter Smith | last post by:
http://www.icarusindie.com/Literature/ebooks/ Rather than advocating wasting money on expensive books for beginners, here's my collection of ebooks that have been made freely available on-line...
13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
0
by: Mark Phanides | last post by:
My ASP.NET application intermittantly (but always at same point) redirects to the 'Invalid Syntax Error' web page for some unknown reason. I've created a ASP.NET application written in VB.NET with...
0
by: Lysander | last post by:
Thought I would give something back with a few articles. This article is a bit of code to add error handling. When I have time, I want to write articles on multilingual databases, and Access...
9
by: MrDeej | last post by:
Hello guys! We have an SQL server which sometimes makes timeouts and connection errors. And we have an function witch writes and updates data in 2 tables on this server. When the SQL server error...
2
by: buddyr | last post by:
Hello, I am using code with exception handling C# - have visual studio 2008 code: try{int mysum=Int.Parse(textbox1.text);} catch{messagebox.show("mistake" + ex.message);} intellisense does...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.