Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857226
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857234
Share on other sites

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!

Link to comment
https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857750
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-857931
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-858694
Share on other sites

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...

Link to comment
https://forums.phpfreaks.com/topic/162391-display_errors/#findComment-858697
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.