fopen() question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
hello, i just recently started getting permission errors when writing
to a file that's been working fine for a couple weeks now. i have made
no changes to the file or folder permission settings and i was
wondering if anyone knew of any other factors that could cause these
types of errors below. thanks in advance for a help with this problem.

$content = "my file content";

// create a filename variable with the .iif extension for Quick Books
$filename = "qbprod.iif";

// delete old file so a new file can be created

// create a new file
$handle = fopen("/home/mysite/www/qbdata/$filename", 'a');

// write the contents to the file
fwrite($handle, $content);

// have dialog box prompt the user to open or save the file
header("Location: =$filename");

Warning: Unlink failed (No such file or directory) in
/home/www/mysite/qbdata/get_product_data.php on line 112

Warning: fopen("/home/goknobs/www/qbdata/qbprod.iif", "a") - Permission
denied in /home/www/mysite/qbdata/get_product_data.php on line 115

Warning: Supplied argument is not a valid File-Handle resource in
/home/www/mysite/qbdata/get_product_data.php on line 118

Warning: Cannot add header information - headers already sent by
(output started at /home/www/mysite/qbdata/get_product_data.php:112) in
/home/www/mysite/qbdata/get_product_data.php on line 121

Re: fopen() question

Did you TRY to reset the folder permission, by chance?  Also, is this
being hosted on your own personal system or is it leased space?  If it
is not your own system, they may be working on something.  Just a

Re: fopen() question

Slant wrote:
Quoted text here. Click to load it

i found out it was something to do with apache assigning the file with
"nobody" permissions. not sure why it started do that out of the blue,
but the host fixed the problem.


re:fopen() question

Well this may be happening because of some server updates, you should
check beside permissions also if you still own those files, meaning
you should check the user and group those files are associated with!

  If you are hosted by a third party try contacting them to fix the

 Hope it helps, Ovidiu

Site Timeline