3

Running PHP under IIS on my Win XP Pro system. I cannot debug my scripts easily because get PHP to write to the error log I specify. Here are the relevant (I think) php.ini entries:

error_reporting  =  E_ALL & E_STRICT
display_errors = Off
log_errors = On
error_log = "c:/php5/log/php.log"

I had the slashes going the Windows/DOS way before. In either case, it did not write to the file php.log in that directory. The log file is writable by IUSR_SERVERNAME, the directory is writable by IUSR_SERVERNAME, the parent directory is writable by IUSR_SERVERNAME. I'm sure I'm missing something stupid.

Any tips?

1
  • I found the problem. I updated my answer. Let me know how it goes Commented Aug 28, 2009 at 14:00

1 Answer 1

4

Have you tried in the php file itself?

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log', "c:/php5/log/php.log");

Update: The problem is that you are using a bitwise AND where you should use a bitwise OR

Try this

var_dump(E_ALL);
var_dump(E_STRICT);
var_dump(E_ALL | E_STRICT);
var_dump(E_ALL & E_STRICT);

output: int(6143) int(2048) int(8191) int(0)

So basically you are writing

error_reporting  =  0

Effectively turning off the error reporting. Change the & for an | in your php.ini and you should be ok.

Sign up to request clarification or add additional context in comments.

4 Comments

Kind of misses the point of having in the INI file, but I'll try it.
Shouldn't it be error_reporting = E_ALL | E_STRICT instead of error_reporting = E_ALL & E_STRICT? & of E_ALL and E_STRICT will return all zeros I think
That was it, thank you very much! Of course, it didn't log an error related to the initial problem, but that's a security issue I have to figure out, not related to the error log.
An interesting side note: I just uncommented the line, so the initial PHP.ini file had it wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.