PHP4->PHP5 can"t see errors on web browser
PHP4->PHP5 can"t see errors on web browser
am 22.08.2007 08:08:12 von Bob Bedford
Hi all,
strange what's appening. I just upgraded from PHP4 to PHP5 and from apache1
to apache2 but I don't see PHP errors on screen anymore (in my case parse
error).
In the log I've errors: PHP parse error....what's strange is that this
script is exactly the same as the one on the server also with php5.
But I found that sometimes I forgot to put
(without php)
How can I set apache or PHP to show those errors on screen instead of only
in the log file. I've set error_reporting = E_ALL in the PHP.ini but I still
have a blank page (in PHP 4 I had the error on screen). In apache NG didn't
help.
Bob
Re: PHP4->PHP5 can"t see errors on web browser
am 22.08.2007 13:22:20 von Jerry Stuckle
Bob Bedford wrote:
> Hi all,
>
> strange what's appening. I just upgraded from PHP4 to PHP5 and from apache1
> to apache2 but I don't see PHP errors on screen anymore (in my case parse
> error).
>
> In the log I've errors: PHP parse error....what's strange is that this
> script is exactly the same as the one on the server also with php5.
> But I found that sometimes I forgot to put
> (without php)
>
> How can I set apache or PHP to show those errors on screen instead of only
> in the log file. I've set error_reporting = E_ALL in the PHP.ini but I still
> have a blank page (in PHP 4 I had the error on screen). In apache NG didn't
> help.
>
> Bob
>
>
Look at your php.ini file.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: PHP4->PHP5 can"t see errors on web browser
am 22.08.2007 16:14:49 von mgirouard
On Aug 22, 2:08 am, "Bob Bedford" wrote:
> Hi all,
>
> strange what's appening. I just upgraded from PHP4 to PHP5 and from apache1
> to apache2 but I don't see PHP errors on screen anymore (in my case parse
> error).
>
> In the log I've errors: PHP parse error....what's strange is that this
> script is exactly the same as the one on the server also with php5.
> But I found that sometimes I forgot to put
> (without php)
>
> How can I set apache or PHP to show those errors on screen instead of only
> in the log file. I've set error_reporting = E_ALL in the PHP.ini but I still
> have a blank page (in PHP 4 I had the error on screen). In apache NG didn't
> help.
>
> Bob
The configuration option you need to set is "display_errors". Make
sure it's on.
Also, you can try putting this at the top of your script:
ini_set('display_errors', 'On');
?>
Re: PHP4->PHP5 can"t see errors on web browser
am 22.08.2007 18:52:18 von Bob Bedford
> The configuration option you need to set is "display_errors". Make
> sure it's on.
Here is my php.ini error handling part:
; Print out errors (as a part of the output). For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web
site
; may reveal security information to end users, such as file paths on your
Web
; server, your database schema or other information.
; display_errors = Off
display_errors = on
; Even when display_errors is on, errors that occur during PHP's startup
; sequence are not displayed. It's strongly recommended to keep
; display_startup_errors off, except for when debugging.
; display_startup_errors = Off
display_startup_errors = On
; Log errors into a log file (server-specific log, stderr, or error_log
(below))
; As stated above, you're strongly advised to use error logging in place of
; error displaying on production web sites.
log_errors = on
; Set maximum length of log_errors. In error_log information about the
source is
; added. The default is 1024 and 0 allows to not apply any maximum length at
all.
log_errors_max_len = 1024
; Do not log repeated messages. Repeated errors must occur in same file on
same
; line until ignore_repeated_source is set true.
ignore_repeated_errors = Off
; Ignore source of message when ignoring repeated messages. When this
setting
; is On you will not log errors with repeated messages from different files
or
; source lines.
ignore_repeated_source = Off
; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This has only effect in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
report_memleaks = On
;report_zend_debug = 0
; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off
; Disable the inclusion of HTML tags in error messages.
; Note: Never use this feature for production boxes.
html_errors = on
; If html_errors is set On PHP produces clickable error messages that direct
; to a page describing the error or function causing the error in detail.
; You can download a copy of the PHP manual from http://www.php.net/docs.php
; and change docref_root to the base URL of your local copy including the
; leading '/'. You must also specify the file extension being used including
; the dot.
; Note: Never use this feature for production boxes.
;docref_root = "/phpmanual/"
;docref_ext = .html
; String to output before an error message.
;error_prepend_string = ""
; String to output after an error message.
;error_append_string = ""
; Log errors to specified file.
;error_log = filename
; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog
Seems OK...I don't understand.
Re: PHP4->PHP5 can"t see errors on web browser
am 22.08.2007 20:08:02 von Jerry Stuckle
Bob Bedford wrote:
>> The configuration option you need to set is "display_errors". Make
>> sure it's on.
>
> Here is my php.ini error handling part:
> ; Print out errors (as a part of the output). For production web sites,
> ; you're strongly encouraged to turn this feature off, and use error logging
> ; instead (see below). Keeping display_errors enabled on a production web
> site
> ; may reveal security information to end users, such as file paths on your
> Web
> ; server, your database schema or other information.
> ; display_errors = Off
> display_errors = on
>
> ; Even when display_errors is on, errors that occur during PHP's startup
> ; sequence are not displayed. It's strongly recommended to keep
> ; display_startup_errors off, except for when debugging.
> ; display_startup_errors = Off
> display_startup_errors = On
>
> ; Log errors into a log file (server-specific log, stderr, or error_log
> (below))
> ; As stated above, you're strongly advised to use error logging in place of
> ; error displaying on production web sites.
> log_errors = on
>
> ; Set maximum length of log_errors. In error_log information about the
> source is
> ; added. The default is 1024 and 0 allows to not apply any maximum length at
> all.
> log_errors_max_len = 1024
>
> ; Do not log repeated messages. Repeated errors must occur in same file on
> same
> ; line until ignore_repeated_source is set true.
> ignore_repeated_errors = Off
>
> ; Ignore source of message when ignoring repeated messages. When this
> setting
> ; is On you will not log errors with repeated messages from different files
> or
> ; source lines.
> ignore_repeated_source = Off
>
> ; If this parameter is set to Off, then memory leaks will not be shown (on
> ; stdout or in the log). This has only effect in a debug compile, and if
> ; error reporting includes E_WARNING in the allowed list
> report_memleaks = On
>
> ;report_zend_debug = 0
>
> ; Store the last error/warning message in $php_errormsg (boolean).
> track_errors = Off
>
> ; Disable the inclusion of HTML tags in error messages.
> ; Note: Never use this feature for production boxes.
> html_errors = on
>
> ; If html_errors is set On PHP produces clickable error messages that direct
> ; to a page describing the error or function causing the error in detail.
> ; You can download a copy of the PHP manual from http://www.php.net/docs.php
> ; and change docref_root to the base URL of your local copy including the
> ; leading '/'. You must also specify the file extension being used including
> ; the dot.
> ; Note: Never use this feature for production boxes.
> ;docref_root = "/phpmanual/"
> ;docref_ext = .html
>
> ; String to output before an error message.
> ;error_prepend_string = ""
>
> ; String to output after an error message.
> ;error_append_string = ""
>
> ; Log errors to specified file.
> ;error_log = filename
>
> ; Log errors to syslog (Event Log on NT, not valid in Windows 95).
> ;error_log = syslog
>
> Seems OK...I don't understand.
>
>
Are you sure this is the php.ini you're using? What does phpinfo() show
you?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: PHP4->PHP5 can"t see errors on web browser
am 22.08.2007 23:46:04 von luiheidsgoeroe
On Wed, 22 Aug 2007 16:14:49 +0200, Mike G. wrote:
> Also, you can try putting this at the top of your script:
>
>
>
> ini_set('display_errors', 'On');
>
> ?>
Which wouldn't work for parse-errors BTW. Nothing gets evaluated, so
'there is no ini_set'.
--
Rik Wasmus
Re: PHP4->PHP5 can"t see errors on web browser
am 24.08.2007 19:40:33 von unknown
Post removed (X-No-Archive: yes)
Re: PHP4->PHP5 can"t see errors on web browser
am 25.08.2007 15:08:32 von severin
You're in the right way Bob,
php.ini and httpd.conf specifie the behaviour of apache.
I had the same problem:
e_all error is to be set;
and further in the php.ini the
display-error:ON.
And be carefull to work on the right php.ini file!!!!!!!!!
( they may be several, only the good one acts on apache).
php.ini or httpd.conf -don't rememlber) specifie also the tag to be
interpreted:
sometimes: and
sometimes: only
That why on two different configuraiotn, the same code behave
differently, depending on specified "open tags".
And specifie the extension to be treated by php: php, php5,php3...
if you add here "txt" for example, then all .txt files would be
interpreted like php files.
if your old script names php3 and this extension is not specified in
your new httpd.conf, all php3 files will be shown as text.
Tom wrote:
> On Wed, 22 Aug 2007 08:08:12 +0200, Bob Bedford wrote...
>
>>Hi all,
>>
>>strange what's appening. I just upgraded from PHP4 to PHP5 and from apache1
>>to apache2 but I don't see PHP errors on screen anymore (in my case parse
>>error).
>>
>>In the log I've errors: PHP parse error....what's strange is that this
>>script is exactly the same as the one on the server also with php5.
>>But I found that sometimes I forgot to put
>>(without php)
>>
>>How can I set apache or PHP to show those errors on screen instead of only
>>in the log file. I've set error_reporting = E_ALL in the PHP.ini but I still
>>have a blank page (in PHP 4 I had the error on screen). In apache NG didn't
>>help.
>>
>>Bob
>>
>>
>
>
>
> How were the upgrades, did you do them individually from source code or did you
> have packages for those with your OS? I need to update PHP and several other
> software programs, but was interested what approach you took.
>
> Tom
Re: PHP4->PHP5 can"t see errors on web browser
am 30.08.2007 15:23:29 von Bob Bedford
Merci beaucoup Séverin,
Actually it was because I modified the wrong php.ini. It seems that PHP5
doesn't need to put it's path in system.ini and I was still modifying the
php.ini in windows system directory.