By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,890 Members | 1,048 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,890 IT Pros & Developers. It's quick & easy.

Error reporting

P: n/a
I have PHP 4.3.7 running on my client's Windows 2003 server. The same
computer also runs SQL Server and I am trying to connect from PHP to a
database. This fails, so I would like to track down the cause for this
failure.

However, PHP does not display error messages about the failure. I have tried
these:

php.ini:
display_errors = On

test.php:
error_reporting(E_ALL);

phpinfo() says error_reporting is set to 2047 (E_ALL).

Yet I still do not get any errors.

Even when I write arglebargle code, PHP still produces a blank HTML-page
instead of syntax error message.

Are there any other settings in addition to the two forementioned which may
affect error reporting?

-Jani
Jul 17 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
"Jani Jalkala" <ja**********@mail.htk.fi> wrote in message
news:cl***************@read3.inet.fi...
I have PHP 4.3.7 running on my client's Windows 2003 server. The same
computer also runs SQL Server and I am trying to connect from PHP to a
database. This fails, so I would like to track down the cause for this
failure.

However, PHP does not display error messages about the failure. I have tried these:

php.ini:
display_errors = On

test.php:
error_reporting(E_ALL);

phpinfo() says error_reporting is set to 2047 (E_ALL).

Yet I still do not get any errors.

Even when I write arglebargle code, PHP still produces a blank HTML-page
instead of syntax error message.

Are there any other settings in addition to the two forementioned which may affect error reporting?

-Jani


Does PHP code without withoug database access code run properly?

Show us your code. We are only guessing that you want to connect to SQL
Server. You only said it runs on the same box. For all I know you're trying
to access a mySQL server on some other box. You didn't say how you were
attempting to connect. ODBC? For all we know, you are using incorrect
function calls all around.

- Virgil
Jul 17 '05 #2

P: n/a
The database connection was only a reference to what I was ultimately trying
to achieve. At the moment, I don't want help with the connection problems.

My problem was about PHP not displaying error messages, even after I have
(supposedly) turned on all necessary directives in php.ini and manually with
error_reporting().

The following code in test.php:

<?php
arglebargle
?>

Does not display error messages, but this HTML output:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:a4*****************@newssvr22.news.prodigy.co m...
"Jani Jalkala" <ja**********@mail.htk.fi> wrote in message
news:cl***************@read3.inet.fi...
I have PHP 4.3.7 running on my client's Windows 2003 server. The same
computer also runs SQL Server and I am trying to connect from PHP to a
database. This fails, so I would like to track down the cause for this
failure.

However, PHP does not display error messages about the failure. I have tried
these:

php.ini:
display_errors = On

test.php:
error_reporting(E_ALL);

phpinfo() says error_reporting is set to 2047 (E_ALL).

Yet I still do not get any errors.

Even when I write arglebargle code, PHP still produces a blank HTML-page
instead of syntax error message.

Are there any other settings in addition to the two forementioned which

may
affect error reporting?

-Jani


Does PHP code without withoug database access code run properly?

Show us your code. We are only guessing that you want to connect to SQL
Server. You only said it runs on the same box. For all I know you're

trying to access a mySQL server on some other box. You didn't say how you were
attempting to connect. ODBC? For all we know, you are using incorrect
function calls all around.

- Virgil

Jul 17 '05 #3

P: n/a

"Jani Jalkala" <ja**********@mail.htk.fi> wrote in message
news:0l**************@read3.inet.fi...
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:a4*****************@newssvr22.news.prodigy.co m...

Does PHP code without withoug database access code run properly?

Show us your code. We are only guessing that you want to connect to SQL
Server. You only said it runs on the same box. For all I know you're trying
to access a mySQL server on some other box. You didn't say how you were
attempting to connect. ODBC? For all we know, you are using incorrect
function calls all around.

- Virgil

The database connection was only a reference to what I was ultimately

trying to achieve. At the moment, I don't want help with the connection problems.

My problem was about PHP not displaying error messages, even after I have
(supposedly) turned on all necessary directives in php.ini and manually with error_reporting().

The following code in test.php:

<?php
arglebargle
?>

Does not display error messages, but this HTML output:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>


That code did exactly the same thing on my server.

This, however, gave a fatal error:

<?php
arglebargle();
?>

- Virgil

Jul 17 '05 #4

P: n/a
I would understand if PHP interpreted "arglebargle" as an undefined constant
and simply did nothing on that line, but in that case I would expect a
completely empty output, not the HTML-page it PHP seens to generate.

I have been using PHP on a server provided by our ISP for a while, and a few
years ago they removed displayed error reports due to security reasons,
after which erroneous code started to result in this same empty HTML page
instead of error messages.

Thus I am fairly sure that in my current case PHP does correctly recognize
the errors in the code, but for some reason chooses to not display the error
messages.

In any case, I tried "arglebargle();" as a function call, but that didn't
change the output at all.
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:2J***************@newssvr22.news.prodigy.com. ..

The following code in test.php:

<?php
arglebargle
?>

Does not display error messages, but this HTML output:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>


That code did exactly the same thing on my server.

This, however, gave a fatal error:

<?php
arglebargle();
?>

- Virgil

Jul 17 '05 #5

P: n/a
On Tue, 08 Jun 2004 15:53:21 GMT, "Jani Jalkala" <ja**********@mail.htk.fi>
wrote:
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:2J***************@newssvr22.news.prodigy.com ...
>
> The following code in test.php:
>
> <?php
> arglebargle
> ?>
>
> Does not display error messages, but this HTML output:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html;
> charset=windows-1252"></HEAD>
> <BODY></BODY></HTML>


That code did exactly the same thing on my server.

This, however, gave a fatal error:

<?php
arglebargle();
?>


I would understand if PHP interpreted "arglebargle" as an undefined constant
and simply did nothing on that line, but in that case I would expect a
completely empty output, not the HTML-page it PHP seens to generate.


FWIW isn't the HTML snippet above generated by IE when it gets no output, and
not generated by PHP and/or the webserver? Try viewing a blank file through a
webserver with IE - I get the snippet above in view source from IE, but from
Mozilla I get a blank screen i.e. the actual output.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #6

P: n/a
Oh yes, you are right about that. Still doesn't explain why PHP doesn't
display error messages.
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html;
> charset=windows-1252"></HEAD>
> <BODY></BODY></HTML>
FWIW isn't the HTML snippet above generated by IE when it gets no output,

and not generated by PHP and/or the webserver? Try viewing a blank file through a webserver with IE - I get the snippet above in view source from IE, but from Mozilla I get a blank screen i.e. the actual output.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

Jul 17 '05 #7

P: n/a

"Jani Jalkala" <ja**********@mail.htk.fi> wrote in message
news:Rh***************@read3.inet.fi...
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:2J***************@newssvr22.news.prodigy.com. ..

The following code in test.php:

<?php
arglebargle
?>

Does not display error messages, but this HTML output:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
That code did exactly the same thing on my server.

This, however, gave a fatal error:

<?php
arglebargle();
?>

- Virgil

I would understand if PHP interpreted "arglebargle" as an undefined

constant and simply did nothing on that line, but in that case I would expect a
completely empty output, not the HTML-page it PHP seens to generate.

I have been using PHP on a server provided by our ISP for a while, and a few years ago they removed displayed error reports due to security reasons,
after which erroneous code started to result in this same empty HTML page
instead of error messages.

Thus I am fairly sure that in my current case PHP does correctly recognize
the errors in the code, but for some reason chooses to not display the error messages.

In any case, I tried "arglebargle();" as a function call, but that didn't
change the output at all.


Earlier, you indicated that you had display_errors on in your php.ini file.
Can you confirm that this is also true via phpinfo()? Too often I see people
look in their php.ini only to discover that something else has affected the
settings and they are not really running with those settings.

Please try the code I presented and include a phpinfo() call before the call
to the fake function. Confirm all the parameters from there and report back
along with any output resulting from the fake functions.

- Virgil
Jul 17 '05 #8

P: n/a
Ok, seems that it indeed was my mistake in configuring PHP.

Firstly, I had confused "error_reporting" for "display_errors" when I was
looking at the output from phpinfo(). You were right about that, phpinfo()
did say that display_errors is Off.

After I got that right in my head and applied them to php.ini properly (I
thought), it still didn't work.

Then I browsed through all of php.ini, and noticed that I had changed these
settings in the beginning of the file, in "About this file" section, while
later in the same file the same settings were set to Off. Thus when PHP
interpreted php.ini it took the settings appearing later in the file than my
modifications.

Thanks for your help Virgil and Andy!
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:6_***************@newssvr23.news.prodigy.com. ..

"Jani Jalkala" <ja**********@mail.htk.fi> wrote in message
news:Rh***************@read3.inet.fi...
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:2J***************@newssvr22.news.prodigy.com. ..

>
> The following code in test.php:
>
> <?php
> arglebargle
> ?>
>
> Does not display error messages, but this HTML output:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html;
> charset=windows-1252"></HEAD>
> <BODY></BODY></HTML>

That code did exactly the same thing on my server.

This, however, gave a fatal error:

<?php
arglebargle();
?>

- Virgil
I would understand if PHP interpreted "arglebargle" as an undefined

constant
and simply did nothing on that line, but in that case I would expect a
completely empty output, not the HTML-page it PHP seens to generate.

I have been using PHP on a server provided by our ISP for a while, and a

few
years ago they removed displayed error reports due to security reasons,
after which erroneous code started to result in this same empty HTML page instead of error messages.

Thus I am fairly sure that in my current case PHP does correctly recognize the errors in the code, but for some reason chooses to not display the

error
messages.

In any case, I tried "arglebargle();" as a function call, but that didn't change the output at all.


Earlier, you indicated that you had display_errors on in your php.ini

file. Can you confirm that this is also true via phpinfo()? Too often I see people look in their php.ini only to discover that something else has affected the settings and they are not really running with those settings.

Please try the code I presented and include a phpinfo() call before the call to the fake function. Confirm all the parameters from there and report back along with any output resulting from the fake functions.

- Virgil

Jul 17 '05 #9

P: n/a

"Jani Jalkala" <ja**********@mail.htk.fi> wrote in message
news:pT***************@read3.inet.fi...
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:6_***************@newssvr23.news.prodigy.com. ..

"Jani Jalkala" <ja**********@mail.htk.fi> wrote in message
news:Rh***************@read3.inet.fi...
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message
news:2J***************@newssvr22.news.prodigy.com. ..
>
> >
> > The following code in test.php:
> >
> > <?php
> > arglebargle
> > ?>
> >
> > Does not display error messages, but this HTML output:
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD>
> > <META http-equiv=Content-Type content="text/html;
> > charset=windows-1252"></HEAD>
> > <BODY></BODY></HTML>
>
> That code did exactly the same thing on my server.
>
> This, however, gave a fatal error:
>
> <?php
> arglebargle();
> ?>
>
> - Virgil
>
I would understand if PHP interpreted "arglebargle" as an undefined constant
and simply did nothing on that line, but in that case I would expect a
completely empty output, not the HTML-page it PHP seens to generate.

I have been using PHP on a server provided by our ISP for a while, and a
few
years ago they removed displayed error reports due to security
reasons, after which erroneous code started to result in this same empty HTML

page instead of error messages.

Thus I am fairly sure that in my current case PHP does correctly recognize the errors in the code, but for some reason chooses to not display the

error
messages.

In any case, I tried "arglebargle();" as a function call, but that didn't change the output at all.


Earlier, you indicated that you had display_errors on in your php.ini

file.
Can you confirm that this is also true via phpinfo()? Too often I see

people
look in their php.ini only to discover that something else has affected

the
settings and they are not really running with those settings.

Please try the code I presented and include a phpinfo() call before the

call
to the fake function. Confirm all the parameters from there and report

back
along with any output resulting from the fake functions.

- Virgil

Ok, seems that it indeed was my mistake in configuring PHP.

Firstly, I had confused "error_reporting" for "display_errors" when I was
looking at the output from phpinfo(). You were right about that, phpinfo()
did say that display_errors is Off.

After I got that right in my head and applied them to php.ini properly (I
thought), it still didn't work.

Then I browsed through all of php.ini, and noticed that I had changed

these settings in the beginning of the file, in "About this file" section, while
later in the same file the same settings were set to Off. Thus when PHP
interpreted php.ini it took the settings appearing later in the file than my modifications.

Thanks for your help Virgil and Andy!


Excellent news!

phpinfo() is definitely your friend. I "often" encounter situations where a
setting has been set in multiple places in the php.ini or in the wrong
php.ini. phpinfo() will always tell you what's actually happening rather
than what you think is happening.

- Virgil
Jul 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.