I don't know if it's been mentioned or not, but I have found that unless the
file exists, I can't open it. Have you verified that the file exists and the
user that the script will run as has the appropriate permissions?

-----Original Message-----
From: jon [mailto:jon]On Behalf Of Jon Jacob
Sent: Sunday, April 01, 2001 7:40 PM
Cc: Ales Kunst; [EMAIL PROTECTED]
Subject: Re: [PHP] Problems with files!!!!!


David Robley wrote:

> On Sat, 31 Mar 2001 21:31, Ales Kunst wrote:
> > Hi,
> >
> > I have a strange kind of a problem. I'm cannot write to files on a
> > server (i'm having virtual host) where i got my domain name.
> > The server is running Apache 1.3.x and is having php3.0.8 installed.
> > The code looks like this:
> >
> > <html>
> > <body>
> > <?php
> >     $fcontents = "something";
> >     $fp = fopen("tmp/some.dat", "w");  // trying to open file in my
> > directory tmp/ (i think)
> >     fwrite($fp, $fcontents);
> >     fclose($fp);
> > ?>
> > </body>
> > </html>
> >
> > I cannot write to directory tmp.I get an error from Netscape that
> > "document contains no data" (i changed the directory mode to 777
> > (tmp/)). The strangest part is that this script works fine when i am
> > running it at home. At home i tried to run the script under Windows 98
> > and Linux Mandrake both with Apache 1.3.x with php 4.0.x installed (i
> > don't think this code should have any compatibility problems). On Linux
> > i have put the script to a user directory, just the kind on the server
> > is, and it worked just fine. I think maybe it's the Apache
> > configuration (on the server) which is causing my problem. I would very
> > appreciate any help on this matter (clues what could be wrong).
> >
> > Ales!
>
> Probably permissions still - the parent directory must also be accessible
> to the user that the web server runs as.
>
> --
> David Robley                        | WEBMASTER & Mail List Admin
> RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
> AusEinet                            | http://auseinet.flinders.edu.au/
>             Flinders University, ADELAIDE, SOUTH AUSTRALIA
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

Ah, this may be too simple of an answer but usually the directory is /tmp
not tmp/



_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to