orange08 Posted June 16, 2009 Share Posted June 16, 2009 if i set ini_set ("display_errors", "0"); for my php file, is that all kind of errors will be hidden to users? Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/ Share on other sites More sharing options...
Maq Posted June 16, 2009 Share Posted June 16, 2009 if i set ini_set ("display_errors", "0"); for my php file, is that all kind of errors will be hidden to users? Yes, but you should be fixing your errors before putting your code live. They are still exploitable and a security concern. Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857147 Share on other sites More sharing options...
PFMaBiSmAd Posted June 16, 2009 Share Posted June 16, 2009 And it is much easier if you set display_errors globally in the master php.ini (when you have access to it), in a .htaccess file (when php is running as an Apache module), or in a local php.ini (when php is running as a CGI application.) Setting it in each file means you must manage the setting by altering it in each affected file. And don't forget that each statement in php that generates a Notice or Warning, even if they are not displayed and even if the error_reporting setting causes them not to be reported, still takes at a minimum of 10 times longer to execute than the same statement corrected so that it does not generate an error, because php is still detecting the error and executing its error handling code to try to figure out what to do with that error. Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857226 Share on other sites More sharing options...
orange08 Posted June 16, 2009 Author Share Posted June 16, 2009 And it is much easier if you set display_errors globally in the master php.ini (when you have access to it), in a .htaccess file (when php is running as an Apache module), or in a local php.ini (when php is running as a CGI application.) Setting it in each file means you must manage the setting by altering it in each affected file. ya, thanks for the reminder, i did do as you said in my .htaccess. but, my hosting fail to allow me to create an error log file to keep track of the error. according to them, their hosting fail to make it and i'm the 1st person trying to use error log file in their hosting... so, i just wonder is that really got hosting that cannot support error log? Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857234 Share on other sites More sharing options...
PFMaBiSmAd Posted June 16, 2009 Share Posted June 16, 2009 The log_errors and error_log settings can be set by you anywhere (php.ini/.htaccess/local php.ini/in a script) to cause php detected errors to be logged to the file you specify. Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857243 Share on other sites More sharing options...
orange08 Posted June 17, 2009 Author Share Posted June 17, 2009 The log_errors and error_log settings can be set by you anywhere (php.ini/.htaccess/local php.ini/in a script) to cause php detected errors to be logged to the file you specify. you meant this line php_value error_log /home/mysite/myfolder/php_errors.log can be set anywhere? i set this in my .htaccess but the php_errors.log can't be created...although i create the log file manually, it can't log error... my hosting reply me that their hosting does not support error log file... so, in your experience, how can i able to keep track my error, since the error log file is not supported in my hosting? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857750 Share on other sites More sharing options...
Daniel0 Posted June 17, 2009 Share Posted June 17, 2009 I've never heard about a host that doesn't support logging. Maybe find a better host, it doesn't sound like they know what they're doing. Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857770 Share on other sites More sharing options...
PFMaBiSmAd Posted June 17, 2009 Share Posted June 17, 2009 I'll second that. When most web hosts use the words don't or can't, it really means that they don't know how or can't be bothered to learn to do that. They may in fact be talking about per user web server error log (which would be equally simple for them to properly set up.) Php error handling, including the logging settings being discussed in this thread, is part of the php core. The only requirement is that the file set in the error_log setting is writable by the user that the web server is running under (you may in fact have to set the permissions to allow all users write permissions or create the actual file using php code.) What does a phpinfo(); statement show for the log_errors and error_log settings? Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857931 Share on other sites More sharing options...
orange08 Posted June 18, 2009 Author Share Posted June 18, 2009 They may in fact be talking about per user web server error log (which would be equally simple for them to properly set up.) sorry, what do you meant here? Php error handling, including the logging settings being discussed in this thread, is part of the php core. The only requirement is that the file set in the error_log setting is writable by the user that the web server is running under (you may in fact have to set the permissions to allow all users write permissions or create the actual file using php code.) What does a phpinfo(); statement show for the log_errors and error_log settings? my log_errors is on and error_log value is: /home/mysite/myfolder/php_errors.log my hosting create "myfolder" for me and the permission is 777 and my php_errors.log is manually created and the permission is 644 Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-858694 Share on other sites More sharing options...
Daniel0 Posted June 18, 2009 Share Posted June 18, 2009 How about log_errors and error_reporting? Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-858696 Share on other sites More sharing options...
orange08 Posted June 18, 2009 Author Share Posted June 18, 2009 How about log_errors and error_reporting? as i have replied above, log_errors value is on error_reporting value is 8191 and this is what my hosting replied me this incident is caused by the active open_base of security reason, so the htaccess cannot create file, but only can rewrite existing file. but, as i tried, cannot rewrite existing file too... Quote Link to comment https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-858697 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.