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

error_reporting(E_ALL) fails to show anything - help!!

P: n/a
I am having problems tracing errors in my code using PHP 4.3.9 on Linux
RHEL 4 with Apache 2.0.54

On occasions I see no errors, no parse, no fatal, no warnings, no
notices.. and no code either! No HTML, nothing! I get a completely
blank page with no content whatsoever.

I have at the very top of my page
[PHP]
error_reporting(E_ALL);
[/PHP]

As a test to see if even notices would pop up, but nothing.

What could cause this to happen?

Thanx
Phil

Feb 1 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
>I am having problems tracing errors in my code using PHP 4.3.9 on Linux
RHEL 4 with Apache 2.0.54

On occasions I see no errors, no parse, no fatal, no warnings, no
notices.. and no code either! No HTML, nothing! I get a completely
blank page with no content whatsoever.

I have at the very top of my page
[PHP]
error_reporting(E_ALL);
[/PHP]


My bet is that you have at least:
[PHP]
<?php
error_reporting(E_ALL);
?>
[/PHP]

rather than what you indicated above.

Gordon L. Burditt
Feb 1 '06 #2

P: n/a

Gordon Burditt wrote:
I am having problems tracing errors in my code using PHP 4.3.9 on Linux
RHEL 4 with Apache 2.0.54

On occasions I see no errors, no parse, no fatal, no warnings, no
notices.. and no code either! No HTML, nothing! I get a completely
blank page with no content whatsoever.

I have at the very top of my page
[PHP]
error_reporting(E_ALL);
[/PHP]
My bet is that you have at least:
[PHP]
<?php
error_reporting(E_ALL);
?>
[/PHP]

rather than what you indicated above.


That sounds redundant to me, unclear as to how this will shed light on
my problem.
Phil
Gordon L. Burditt


Feb 1 '06 #3

P: n/a
comp.lang.php wrote:
I am having problems tracing errors in my code using PHP 4.3.9 on Linux
RHEL 4 with Apache 2.0.54

On occasions I see no errors, no parse, no fatal, no warnings, no
notices.. and no code either! No HTML, nothing! I get a completely
blank page with no content whatsoever.

I have at the very top of my page
[PHP]
error_reporting(E_ALL);
[/PHP]

As a test to see if even notices would pop up, but nothing.

What could cause this to happen?

Thanx
Phil


check to see what the log_errors value is set to in php.ini... if it is
1, then you have to check your error.log file rather than the browser.

--
Justin Koivisto, ZCE - ju****@koivi.com
http://koivi.com
Feb 1 '06 #4

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

comp.lang.php wrote:
I am having problems tracing errors in my code using PHP 4.3.9 on Linux
RHEL 4 with Apache 2.0.54


Can you run PHP on a CLI in that machine? That would clear things up.

Try:

echo "<?php phpinfo(); ?> " | /usr/bin/php

- --
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

Un ordenador no es un televisor ni un microondas, es una herramienta
compleja.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD4UoN3jcQ2mg3Pc8RAlqEAJ4iEZGJr7UxpcRF1Yq5c+ A9E2uYFACcCPNe
IV8RwjNjUvne2+GEEL21iNg=
=H1cH
-----END PGP SIGNATURE-----
Feb 2 '06 #5

P: n/a
If error_reporting is set to 0 in php.ini, you won't see any E_PARSE
error message even if you do an error_reporting(E_ALL), as the error
would occur prior to the line being executed.

Feb 2 '06 #6

P: n/a
Iván Sánchez Ortega wrote:
comp.lang.php wrote:
I am having problems tracing errors in my code using PHP 4.3.9 on Linux
RHEL 4 with Apache 2.0.54


Can you run PHP on a CLI in that machine? That would clear things up.

Try:

echo "<?php phpinfo(); ?> " | /usr/bin/php


The CLI and the Apache module may have different configurations.

In my setup, they do

The Apache module
~$ wget http://localhost/info.php -O- 2> /dev/null | grep error_log
<tr><td class="e">error_log</td><td
class="v">/var/www/log/phperrors.log</td><td
class="v">/var/www/log/phperrors.log</td></tr>

This last line, reformatted, becomes
error_log => /var/www/log/phperrors.log => /var/www/log/phperrors.log

The CLI
~$ php /var/www/normal/info.php | grep error_log
error_log => no value => no value

--
If you're posting through Google read <http://cfaj.freeshell.org/google>
Feb 2 '06 #7

P: n/a
Justin Koivisto wrote:
comp.lang.php wrote:
On occasions I see no errors, no parse, no fatal, no warnings, no
notices.. and no code either! No HTML, nothing! I get a completely
blank page with no content whatsoever.

I have at the very top of my page
[PHP]
error_reporting(E_ALL);
[/PHP]

As a test to see if even notices would pop up, but nothing.


check to see what the log_errors value is set to in php.ini... if it is
1, then you have to check your error.log file rather than the browser.


If you want to override the log_errors directive in php.ini, you can do
that with

ini_set('display_errors', 1);
<http://www.php.net/manual/en/ref.errorfunc.php#ini.display-errors>

or, maybe with (I never tested it)

ini_set('error_log', NULL);
<http://www.php.net/manual/en/ref.errorfunc.php#ini.error-log>

--
If you're posting through Google read <http://cfaj.freeshell.org/google>
Feb 2 '06 #8

P: n/a
error_reporting is set to '1', this according to php.ini

Phil

Chung Leong wrote:
If error_reporting is set to 0 in php.ini, you won't see any E_PARSE
error message even if you do an error_reporting(E_ALL), as the error
would occur prior to the line being executed.


Feb 2 '06 #9

P: n/a

comp.lang.php wrote:
error_reporting is set to '1', this according to php.ini

Phil

Chung Leong wrote:
If error_reporting is set to 0 in php.ini, you won't see any E_PARSE
error message even if you do an error_reporting(E_ALL), as the error
would occur prior to the line being executed.


1 is E_ERROR, so you won't not be getting any E_PARSE message.

Feb 3 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.