1

Since I played with a php script, I have no disk space. Before the disk space was at 130MB, now it is at 200 MB - the maximal allowed file size at the webhoster. My Website has 130MB so it seems the log files take the other available disk space. My PHP script used the following functions:

imagepng
imagettftext

I have used imagedestroy. The errors I had in the script were

  • undefined offset
  • use of undefined constant

In which directory I can find the log files which causes this problem?

Solution:

/var/log/httpd called error_log

I removed my error lines and uploaded the file back to the server.

testing
  • 19,681
  • 50
  • 236
  • 417
  • What is your OS? you have SSH access? – Book Of Zeus Oct 07 '11 at 10:25
  • Using to `du` to locate the biggest directories is an option. Read its man page for options. – Mat Oct 07 '11 at 10:26
  • I think its a linux, but i can't make a phpinfo because of empty disk space. I have ftp access. I located a file in /var/log/httpd called error_log and its about 91 MB. Can I remove it? – testing Oct 07 '11 at 10:27
  • 1
    you'd better take a look at it before deleting!!! It contains apache errors, so you can understand what's going on... – Marco Oct 07 '11 at 10:28
  • @testing download it to analyze the errors and try to solve them as Marco said, and then remove it from the ftp – Carlos Campderrós Oct 07 '11 at 10:31
  • Line 80 - Line 553442 contains my error `Use of undefined constant i`, `Undefined variable`, `Undefined index`, `Undefined offset`... but I didn't go through each line because when fast scrolling the error seems the same. Should I delete my errors and upload the error_log back on the server? – testing Oct 07 '11 at 10:33

1 Answers1

1

As I told you in my comment, error_log file inside /var/log/httpd folder is the Apache webserver error log.
When an error occurs inside your script (for example), it's appended in that file.
So it's really important (if you want to understand what's happening) that you take a look at that file to improve your script removing faults.
Then you can try to delete it, even if I'm not sure Apache won't complain because it's using it... Stopping webserver, removing that file and restarting Apache would be a better solution, even if I understands that could be impossible if your web-space is hosted and not under your control...

Marco
  • 56,740
  • 14
  • 129
  • 152
  • I know the errors and I want improve the script, but first I have to get the webserver running. So I have to get disk space. Can I delete the error_log or parts of the content of the error_log? – testing Oct 07 '11 at 10:36
  • 1
    @testing: answer is not easy, because you could try to delete that file, but Apache could complain, I don't know how server is configured; you could also try to remove file content, but in this case file ownership could change (from httpd to your_user for example) and in this case Apache could not be able to use that file anymore... – Marco Oct 07 '11 at 10:41
  • @testing: if you search Google, you'll find that you can't delete that file (everybody tells this) while Apache is running... – Marco Oct 07 '11 at 10:45
  • I removed my error lines and uploaded the file back to the server. Now the server is writing again in this log file, despite there is a error_log.1. Nevertheless my problem has been solved! Thanks for all which contributed to this topic! – testing Oct 07 '11 at 11:18