Re: file permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/7/07, Ross <ross@xxxxxxxxxxxxx> wrote:


n relation to my other posts it is not that the folder permission are not
working, when I put an image inside them the image automatically has a 600
chmod and has the owner is 'nobody'. This  means I cannot delete the files.

mkdir('images/'.$customer_id, 0755);
chown('images/'.$customer_id, 'ross');

with this I get a

Warning: chown() [function.chown]: Operation not permitted


R.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



   Ross,

   In order to chown from one user to another, you either have to be
root or in the wheel group.  The easiest way to handle this is to
either chmod the script that's uploading the files to 6755 (owner can
read/write/execute, group can read/execute, world can read/execute,
runs with user/group permissions), which should (if the server is
configured properly) then make your images owned by yourself.  If not,
or to delete existing data, simply do one of the following:

<?
   exec('rm -fR '.$dir_with_files_to_delete,$ret,$xc);
   $xc == 1 ? $ret : '';
?>

   Or....

<?
   chmod($nobody_owned_dir."/".$nobody_owned_files,0777);
   chmod($nobody_owned_dir,0777);
?>

   Then you should be able to modify and delete the files and
directories from your FTP client.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux