[Tfug] writing files from PHP

Paul Scott waterhorse at ultrasw.com
Thu Jun 19 09:45:31 MST 2008


On Jun 19, 2008, at 9:14 AM, Brian Murphy wrote:

> 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.

Warning: fopen(home.hits) [function.fopen]: failed to open stream:  
Permission denied in /Users/paul/Sites/compmed/count.php on line 18

>
> 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.

 From a php script?  When I touch a new file from the CLI it works  
fine and I own the file.

Thanks,

Paul

p.s.:  I'm going to bring this up at the happy hour tonight.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20080619/c424ee01/attachment-0002.html>


More information about the tfug mailing list