php setting an error log

I'm having a hard time forcing my application to log errors. Here is a file hierarchy:

/opt
  +-lampp
      +-htdocs
        +-project
          +-app
          | +-config
          | | +-errors.php
          | +-controllers
          | +-log
          | | +-error.log
          | +-etc...
          | +-index.php
          +-pub

And here is the errors.php :

<?php
/*
 * This is configuration for error handling
 */

ini_set('safe_mode','off');
//to display errors in browser, set 1
ini_set('display_errors',1);
//to write errors to a  log file, set 1
ini_set('log_errors',1);
//set default file to log errors
ini_set('error_log','app/log/error.log');
//error reporting level, set to E_ALL to see all errors and notices
//error_reporting(E_ALL);
error_reporting(E_ERROR|
        E_WARNING|
        E_CORE_ERROR|
        E_CORE_WARNING|
        E_COMPILE_ERROR|
        E_COMPILE_WARNING|
        E_USER_ERROR|
        E_USER_WARNING|
        E_STRICT|
        E_RECOVERABLE_ERROR|
        E_DEPRECATED|
        E_USER_DEPRECATED);
error_log('hi');

I read in some article that this might be caused by the safe mode, so i turned it of, but it changed nothing.

Also have an idea that my path might be wrong, in that case, what should it be?

I realise that this question was asked before, but i have already read these articles and they didn't helped me. Even though this is a kind of a "debug my code" question, could someone help me?

(p.s. im sure the error.php file was reached and executed.) (p.p.s. error.php is included in index.php)

EDIT:

So i commented the safe mode line and dumped these lines:

error_reporting => int(22527)

error_log => bool(true)

Answers


Thank you for the posts, i learned quite a couple of things from them. When i tried the absolute path i learned that the problem is in file rights. All i had to do is

sudo chmod 777 error.log

Anyway, is it a good idea to have a file with 777 rights in your project directory?


Need Your Help

How to resolve issues with using external packages in IntelliJ?

java intellij-idea packages libraries rserve

I recently switched from eclipse to Intellij and hence I am new new to it. Till a day before I was successfully able to compile my java program (maven) and generate output. The program uses multiple

Facebook Graph Api Like custom action approval changes

facebook facebook-graph-api facebook-like like

I create a custom facebook graph action named "Like" with my custom object say "Photo" and also set Inherits From to Like. Now when i submit for approval they send back for changes with following m...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.