[thelist] fopen and fclose Errors

Judah McAuley judah at wiredotter.com
Sun Sep 21 10:47:56 CDT 2008


chmod is usally a function that you would have to have elevated privileges
to perform. Ideally, PHP would be running in an account with only the
minimum of privileges. So you would want to go an chmod the files (or chown
the directory) from the command line or a web hosting control panel or some
such. You should only need to do that once, not every time in your code. If
you have problems figuring out how to do that, consult your hosting
provider.

Judah

On Sun, Sep 21, 2008 at 1:39 AM, Daniel Padolsky <padolsky at gmail.com> wrote:

> I'm trying to create an XML file in a folder online and I get the following
> errors:
>
> Warning: fwrite(): supplied argument is not a valid stream resource in
> /DISK3/WWW/conway.cz/www/quizzes/XML/XML_doc_processing.php on line 68
> Warning: fclose(): supplied argument is not a valid stream resource in
> /DISK3/WWW/conway.cz/www/quizzes/XML/XML_doc_processing.php on line 69
>
> I've been told that I need to chmod the folder, so I did this:
>
>        $file = getNextFilename($dir, 'quiz', 'xml');
>        chmod("http://www.conway.cz/quizzes/$file", 0777);
>
> And then I got the following error:
>
> Warning: chmod() [function.chmod]: stat failed for
> http://www.conway.cz/quizzes/ in
> /DISK3/WWW/conway.cz/www/quizzes/XML/XML_doc_processing.php on line 23
>
> Can someone tell me what I'm doing wrong? Thanks.
> Dan
>
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list