You are not logged in.

#1 2017-08-10 19:27:16

rinzler
Member
Registered: 2017-07-27
Posts: 16

[SOLVED]Php7 not showing error and warning messages in browsers!

I have installed Apache server and php in my system. I changed my Document root to "/home/my_username/Documents/http" and I added some virtual hosts.
Everything is working fine. Php scripts are also executing perfectly. But the problem is if any error occurred in php file browser showing blank page for that php file. Browser not showing php errors as in the  php 5.x versions. I have googled some information that php error handling is changed. Please help me find the perfect solution so that I can get those errors as in the php 5.x version.

My php version is

PHP 7.1.8 (cli) (built: Aug  1 2017 20:49:37) ( NTS )

Last edited by rinzler (2017-08-14 17:51:33)

Offline

#2 2017-08-10 20:10:51

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: [SOLVED]Php7 not showing error and warning messages in browsers!

Show us how you have configured the error output in your php.ini file. What else have you tried?


Matt

"It is very difficult to educate the educated."

Offline

#3 2017-08-10 20:22:10

rinzler
Member
Registered: 2017-07-27
Posts: 16

Re: [SOLVED]Php7 not showing error and warning messages in browsers!

I didn't changed the php.ini file because its default settings are enough to show the errors.
However my error configuration is php.ini file is:

display_errors = On
;   Default Value: On
;   Development Value: On
;   Production Value: Off

; display_startup_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

error_reporting = E_ALL ^ E_NOTICE ^ E_WARNING
;   Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
;   Development Value: E_ALL
;   Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

Offline

#4 2017-08-14 03:08:18

severach
Member
Registered: 2015-05-23
Posts: 192

Re: [SOLVED]Php7 not showing error and warning messages in browsers!

My errors are always shut off in php.ini. I turn them on as needed at run time.

ini_set('display_errors','0'); // set to 0 for production systems, 1 for debug systems

Let's see what the programs report.

% php -i | grep 'display_errors'
display_errors => Off => Off

Create a php web page with this code and view it.

<?php echo "It works for ".$_SERVER["REMOTE_ADDR"]; phpinfo(); ?>

Last edited by severach (2017-08-14 03:09:13)

Offline

#5 2017-08-14 17:47:53

rinzler
Member
Registered: 2017-07-27
Posts: 16

Re: [SOLVED]Php7 not showing error and warning messages in browsers!

Thank you for the reply.
display_error setting is there in php.ini two times.
Second time it is configured as Off.
Changed it to On.
Now php showing errors are working.

Thank you again..

;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On

display_errors = On

Offline

Board footer

Powered by FluxBB