Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Stop Error Log On Apache

Featured Replies

Hi guys this is my first post, which i wish it wasnt.

 

Ive been a php developer for a while now but never have i had to do this, as being a developer my job is to fix and not hide bad coding.

 

When i say bad coding at the time it was good coding but as its php4 and alot of it has depreciated its not the old programmers fault.

 

Anyway my friend has asked me to make it so the website does not submit a error report as the website is storing a GB a month which is huge, when you look at it, its all things like split() function which is depreciated in php5.3, it still works but it sends an error to the log.

 

The reason why its taking a GB a month is he has about 5000 page views a day, which each page gives of 3 reports, so thats 15000 lines of code a day.

 

He states he has no money so cant get me to rewrite his site but can i turn of the reporting.

 

I asked if i could get into his php.ini and he states i cant as he is a shared hosting platform.

 

So my question is can i use for instance:

 

<?php
error_log(Off);
?>

 

at the top off the page?

 

If not how do i go about this?

 

Thanks

 

Will

Try

error_reporting(E_NONE);

 

Do you have access to the php.ini file etc? Or are you on shared hosting?

Also, why not just set up a cron job to delete the log file every couple of hours or so?

Edited by Jay Gilford

This sounds like my worse nightmare.

 

As Jay said, error_reporting(E_NONE); should "HIDE" the problem.

 

 

IMO if your friends getting 5000 page views a day, he should FIX the problem!

  • Author

Try

error_reporting(E_NONE);

 

Do you have access to the php.ini file etc? Or are you on shared hosting?

Also, why not just set up a cron job to delete the log file every couple of hours or so?

 

I have no access to the php.ini file, also he can only give me access to ftp public_html and database through phpmyadmin,

 

The ex web design company do not offer anything else.

 

You state error_reporting(E_NONE); should fix it

 

Will this stop apache sending it to logs as error reporting is already set to hide all information anyway.

  • Author

This sounds like my worse nightmare.

 

As Jay said, error_reporting(E_NONE); should "HIDE" the problem.

 

 

IMO if your friends getting 5000 page views a day, he should FIX the problem!

 

As the website is a hobby website and he makes no money at all, it costs him £30 a month infact for server costs.

 

He has been quoted £800 and to be fair when i look at it, as its all oop and complex at times i would also quote him about the same.

 

He doesnt have that money to spend on a hobby so as it works he just wants to stop apache generating errors.

 

For instance alot of it is from broken links from old posts which google chuck at it and referring websites but most are from old functions which will not be around for much longer.

If he has to pay £30/month for a server, he should have access to create cron jobs to delete the file, or get the hosting company to set one up (it would be in their interest too). If he doesn't have that kind of access, then he would be better off moving to a better host on a vps for a similar cost, such as Web Fusion who give 100GB space and 2GB RAM for what he's paying now

  • Author

If he has to pay £30/month for a server, he should have access to create cron jobs to delete the file, or get the hosting company to set one up (it would be in their interest too). If he doesn't have that kind of access, then he would be better off moving to a better host on a vps for a similar cost, such as Web Fusion who give 100GB space and 2GB RAM for what he's paying now

 

I know i have said this to him.

 

His exact words is if its not broke then dont fix, i said it is broke that is why you need a fix.

 

He then states its not broken as it still works, its just that php are warning that they are discontinuing it... lol...

 

To be honest i think he is slowely getting bored of the site and eventually he will sell the site.

 

He wont get a lot for it but maybe a few hundred because its a pr5 and has alot of traffic.

I know i have said this to him.

 

His exact words is if its not broke then dont fix, i said it is broke that is why you need a fix.

 

He then states its not broken as it still works, its just that php are warning that they are discontinuing it... lol...

 

To be honest i think he is slowely getting bored of the site and eventually he will sell the site.

 

He wont get a lot for it but maybe a few hundred because its a pr5 and has alot of traffic.

Fair enough, well they're the only solutions really. Like you say, it is broke and he does need it fixing. You could use unlink at the top of a page that is popular enough to be visited a few times a day, but not going to get hammered to delete the file each time it's viewed

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.