[Tfug] writing files from PHP

Brian Murphy murphy+tfug at email.arizona.edu
Thu Jun 19 09:14:07 MST 2008


Quoting Paul Scott <waterhorse at ultrasw.com>:
> On Jun 18, 2008, at 5:36 PM, Brian Murphy wrote:
>> Check your safe_mode and open_basedir settings.  They could
>> restrict the
>> fopen function.
>
> Neither problem machine has those defined (in php.ini).
>


The fopen() documentation says on failure, FALSE is returned and the
error is written at the E_WARNING log level.  Turn your logging up to
this level if it's not already there and send the error along with the
uid the script runs as and the owner, group, and mode of the directory
you're trying to access.

If you're unsure of the uid, open the directory permissions to 777,
touch() a new file (so that it's created), and set the directory mode
back to something sane.  Look at the file owner to see the uid.

Brian


The opinions or statements expressed herein are my own and should not be
taken as a position, opinion, or endorsement of the University of
Arizona.






More information about the tfug mailing list