Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 10-31-2017, 03:57 AM
seodaikaads seodaikaads is offline
Contributing Member
 
Join Date: 05-02-14
Posts: 188
iTrader: 0 / 0%
How to enable php display_errors?

I cannot enable the display_errors setting in PHP. What could be the reason?

I'm using virtual box with PHP 5.3 installed with apache2 running. I have tried everything to get display errors but nothing seems to work.

I have set php_flag display_errors on in my htaccess file and enabled it directly in the php.ini file

I tried the below two format
1. Code: display_errors = 1
2. Code:display_errors = On
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 10-31-2017, 04:25 AM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 13,450
iTrader: 4 / 100%
I think my ini file is 5.4 but the two should be about the same.

PHP Code:
The following are all the settings which are different in either the production
; or development versions of the INIs with respect to PHP's default behavior.
; Please see the actual settings later in the document for more details as to why
; we recommend these changes in PHP'
s behavior.

allow_call_time_pass_reference
;   Default ValueOn
;   Development ValueOff
;   Production ValueOff

display_errors
;   Default ValueOn
;   Development ValueOn
;   Production ValueOff

display_startup_errors
;   Default ValueOff
;   Development ValueOn
;   Production ValueOff

error_reporting
;   Default ValueE_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
;   Development ValueE_ALL
;   Production ValueE_ALL & ~E_DEPRECATED & ~E_STRICT 
and further down in the ini file:

PHP Code:
Error Level Constants:
E_ALL             All errors and warnings (includes E_STRICT as of PHP 6.0.0)
E_ERROR           fatal run-time errors
E_RECOVERABLE_ERROR  almost fatal run-time errors
E_WARNING         run-time warnings (non-fatal errors)
E_PARSE           compile-time parse errors
E_NOTICE          run-time notices (these are warnings which often result
;                     from a bug in your codebut it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it'
s automatically initialized to an
;                     empty string)
E_STRICT          run-time noticesenable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
E_CORE_ERROR      fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP'
s
;                     initial startup
E_COMPILE_ERROR   fatal compile-time errors
E_COMPILE_WARNING compile-time warnings (non-fatal errors)
E_USER_ERROR      user-generated error message
E_USER_WARNING    user-generated warning message
E_USER_NOTICE     user-generated notice message
E_DEPRECATED      warn about code that will not work in future versions
;                     of PHP
E_USER_DEPRECATED user-generated deprecation warnings
;
Common Values:
;   
E_ALL (Show all errorswarnings and notices including coding standards.)
;   
E_ALL & ~E_NOTICE  (Show all errorsexcept for notices)
;   
E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errorsexcept for notices and coding standards warnings.)
;   
E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
; Default 
ValueE_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
Development ValueE_ALL
Production ValueE_ALL & ~E_DEPRECATED & ~E_STRICT
http://php.net/error-reporting
;error_reporting E_ALL E_STRICT remarked 2-1-13
error_reporting 
E_ERROR E_RECOVERABLE_ERROR 

Even if error reporting is correctly set on there are routines that might be added to scripts that suppresses them. This page provides some information about that: https://stackoverflow.com/questions/...errors-php-5-3
 
Reply With Quote
  #3  
Old 10-31-2017, 11:17 AM
J. H. Rasmussen J. H. Rasmussen is online now
Super Moderator
 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 5,937
iTrader: 1 / 100%
Adding this PHP-code to the beginning of a PHP-script will display errors for that file(if the warning/error occur after those two lines has been processed by PHP):
Quote:
error_reporting(E_ALL);
ini_set('display_errors', 1);
Also remember if you make changes to the php.ini-file then you may need to restart the server for the changes to take affect.
 
Reply With Quote
  #4  
Old 12-17-2017, 05:06 AM
AndriusDono AndriusDono is offline
Junior Member
 
Join Date: 12-15-17
Posts: 9
iTrader: 0 / 0%
To make things even more clear, you should restart apache/nginx (or other web server), but not your whole server (reboot command).
 
Reply With Quote
  #5  
Old 02-19-2018, 10:08 PM
aesthetiqclinic aesthetiqclinic is offline
Contributing Member
 
Join Date: 01-04-18
Posts: 54
iTrader: 0 / 0%
You should go to php.ini file in the server that if you have local server to uncomment that error displaying to see the errors.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display image based on date using PHP HTMLBasicTutor Coding Forum 2 10-09-2017 01:48 PM
PHP /Magento developer who has a passion for developing complex solutions rjtexas17 Sell Web Services 0 07-12-2017 04:58 AM
SEEKING Web Development Work, Magento, Wordpress, Marketing, HTML, PHP rjtexas17 Sell Web Services 0 07-06-2017 01:19 AM
Shared: inventivehosting.co.uk (25% OFF Recurring) inventive Web Hosting 0 03-21-2017 05:18 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:13 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC