Saturday, February 25, 2012

Warning: fopen(file.txt): failed to open stream

In your PHP script, if you get an error like below, then it definitely means that you are missing the read/write like operation parameter.

Warning: fopen(file.txt): failed to open stream: Bad file descriptor in C:\test.php

Lets consider the below code,

$fh_out = fopen($filename, $mode);

Here in your case, you are providing invalid value inside $mode and it is causing the error. change it into anything like 'w', 'r', etc.

No comments:

Get function name programaticaly - Python

This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...