Robin
Robin

Reputation: 443

No error_log created on Apache

I'm using the error_log(); function to log significant problems/warnings in my script. Normally an error_log file was created on my shared server, in the same dir as the file that caused the problem.

However, since I'm moved to a virtual private server, error_log files aren't created anymore. I really have no idea about how to solve this problem.. Already tried ini_set('log_errors','1'); and ini_set('error_log','error_log.log'); but they just don't appear.

Anybody knows what to do about this?

Thanks!

Upvotes: 0

Views: 958

Answers (1)

Akarun
Akarun

Reputation: 3350

I suppose you have somethink like this:

error_log("My error message", 0);

Some ways, you'll can explore:

  1. Check the second parameters (0) : http://be.php.net/manual/en/function.error-log.php
  2. Is there a global "error_log" in "/var/log/apache2/error_log, with your message
  3. If you have a "VirtualHost" defined, have you the "ErrorLog" directive set
  4. Is the directory is writable by apache.

If you have :

error_log("My error message", 3, 'error_log.log');

Your current directory must be writable by apache (the executer of the script).

Aka

Upvotes: 2

Related Questions