For Programmers: Free Programming Magazines  


Home > Archive > PHP Installation > May 2007 > Re: [PHP-INSTALL] no PHP scripts can write to files









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-INSTALL] no PHP scripts can write to files
Tim McGeary

2007-05-31, 7:02 pm

No, I don't have the open_basedir configured. It is currently commented
out.

Tim

Carlos A. Benavente wrote:
> Not 100% sure, but this may be due to an open_basedir restriction? Do
> you have this directive set?
>
> I ran into a similar problem with *uploading* files via http and the
> move_uploaded_file function, still can't write/create new files though,
> and one thing I learned is that if you have the open_basedir set to, say
> "./", and want to upload files, that you should also specify a /tmp
> directory on your php.ini's file_upload_dir directive.
>
> When you upload files with the move_uploaded_file function, it first
> creates a temp file on your /tmp directory and then moves it to the
> final target path. Now if you are opening a file for write, not sure if
> the file is copied 1st to the /tmp directory, it gets modified, and then
> moved to its final destination. If the latter is the case, then you may
> want set additional php_admin_value open_basedir values and include /tmp
>
> Hope this makes sense.
>
> Carlos
>
> Tim McGeary wrote:
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com