Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2012, 11:00 PM   PM User | #1
devinmaking
Regular Coder

 
Join Date: Oct 2011
Posts: 236
Thanks: 11
Thanked 5 Times in 5 Posts
devinmaking has a little shameless behaviour in the past
How to stop website writing error logs

Hi

I know this is not practical and should not be done. My friends website is written in php4 and alot of his functions are depreciated in php5.3.

His website still works on his server 100% but its chucking alot of error reports to the server.

He doesnt want me to rewrite the site which is pretty big as he has no money and personally i have no time at the moment.

He has stated that he just wants to make the site to stop sending errors to the errors log on the server, it can run up alot in a year and he wants to stop it rather than spending time doing it every month.

Is there a function like error_log(NULL); which i can just put at the top of every page to prevent this from happening.

I have looked on php.net but to nothing there.

Also if i cant do this, if i make a php.ini file and upload it to sever and just add the lines:

log_errors = Off

Will that work?
devinmaking is offline   Reply With Quote
Old 01-09-2012, 11:39 PM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,222
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
I'd check what the current php error logging settings are for his account. You can see that by running a php file with phpinfo() in it. And then as you mentioned you can override the error logging directive in the master PHP ini file with the local copy of the php.ini file.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 01-10-2012, 09:10 AM   PM User | #3
devinmaking
Regular Coder

 
Join Date: Oct 2011
Posts: 236
Thanks: 11
Thanked 5 Times in 5 Posts
devinmaking has a little shameless behaviour in the past
Quote:
Originally Posted by Spookster View Post
I'd check what the current php error logging settings are for his account. You can see that by running a php file with phpinfo() in it. And then as you mentioned you can override the error logging directive in the master PHP ini file with the local copy of the php.ini file.
As the website is hosted on a shared hosting account the mast php.ini is not available for access. So it would need to be done within a setup php.ini uploaded into the public_html section.

Can this be done?
devinmaking is offline   Reply With Quote
Old 01-10-2012, 09:15 AM   PM User | #4
BluePanther
Senior Coder

 
Join Date: Jul 2011
Posts: 1,226
Thanks: 3
Thanked 171 Times in 171 Posts
BluePanther is on a distinguished road
Quote:
Originally Posted by Spookster View Post
I'd check what the current php error logging settings are for his account. You can see that by running a php file with phpinfo() in it. And then as you mentioned you can override the error logging directive in the master PHP ini file with the local copy of the php.ini file.
I would contact your web host for advice though.
__________________
Useful function to retrieve difference in times
The best PHP resource
A good PHP FAQ
PLEASE remember to wrap your code in [PHP] tags.
PHP Code:
// Replace this
if(isset($_POST['submitButton']))
// With this
if(!empty($_POST))
// Then check for values/forms. Some IE versions don't send the submit button 
Quote:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Last edited by BluePanther; 01-10-2012 at 09:17 AM..
BluePanther is offline   Reply With Quote
Old 01-10-2012, 09:51 AM   PM User | #5
devinmaking
Regular Coder

 
Join Date: Oct 2011
Posts: 236
Thanks: 11
Thanked 5 Times in 5 Posts
devinmaking has a little shameless behaviour in the past
Quote:
Originally Posted by BluePanther View Post
I would contact your web host for advice though.
His host is within america and would cost a fortune to ring, as i am not getting paid and only helping out i would not want to ring lol and what ive been told the email support is not responsive lol..

You stated check the error log in the phpinfo function which i have,

The function shows:

error_log => local value= "no value" & master calue = "no value"
log_errors = on

would i setup a php.ini with the error_log = Off within it?

What information would that say on how its setup?

Thanks

Last edited by devinmaking; 01-10-2012 at 09:55 AM..
devinmaking is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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


All times are GMT +1. The time now is 05:21 AM.


Advertisement
Log in to turn off these ads.