DannyTip Posted October 17, 2006 Share Posted October 17, 2006 Im using php to create a directory on the server when a user on my script is added. Using the following..[code]mkdir("../client/images/".$imgdir."/", 0755);mkdir("../client/images/thumbnails/".$imgdir."/", 0755);[/code]All this works prefectly fine. The problem comes when the user then tries to log in via ftp and upload files into this directory to which permission denied errors are returned. Its possible for the user to delete the directory fine but they are not allowed to upload files into it. Is there anyway arround this?Im guessing its a problem todo with users where 'apache' owns the directory. but surely the permission 755 allows any user to read/write ? Link to comment https://forums.phpfreaks.com/topic/24265-php-mkdir-ftp-permissions-error/ Share on other sites More sharing options...
rab Posted October 17, 2006 Share Posted October 17, 2006 Try 766, that gives the owner of it rwx, groups rw- and others rw-. 755 is r-x, which is read and execute not write Link to comment https://forums.phpfreaks.com/topic/24265-php-mkdir-ftp-permissions-error/#findComment-110263 Share on other sites More sharing options...
DannyTip Posted October 17, 2006 Author Share Posted October 17, 2006 I tried 0766 and 0777 but the directory created still seams to be 755 according to my ftp client. Link to comment https://forums.phpfreaks.com/topic/24265-php-mkdir-ftp-permissions-error/#findComment-110267 Share on other sites More sharing options...
DannyTip Posted October 17, 2006 Author Share Posted October 17, 2006 After some playing around and realising i was uploading the wrong file :'(766 is producing a chmod of 744777 is producing a chmod of 755666 is producing a chmod of 644 Link to comment https://forums.phpfreaks.com/topic/24265-php-mkdir-ftp-permissions-error/#findComment-110282 Share on other sites More sharing options...
rab Posted October 17, 2006 Share Posted October 17, 2006 Odd, i tried this on my linux box via phpcli[code=php:0]<? mkdir( "test", 0766 ); exec("touch test/testfile");?>[/code][code][~] $ php t.php[~] $ ls -aldrwxr--r-- 2 rab users 4096 2006-10-17 17:46 test[~] $ ls -al testtotal 8drwxr--r-- 2 rab users 4096 2006-10-17 17:46 .drwxr-xr-x 58 rab users 4096 2006-10-17 17:46 ..-rw-r--r-- 1 rab users 0 2006-10-17 17:46 testfile[/code]Wierd how it's drwxr--r-- when it should be drwxrw-rw- but the file still wrote Link to comment https://forums.phpfreaks.com/topic/24265-php-mkdir-ftp-permissions-error/#findComment-110286 Share on other sites More sharing options...
DannyTip Posted October 17, 2006 Author Share Posted October 17, 2006 Still nothing :( Link to comment https://forums.phpfreaks.com/topic/24265-php-mkdir-ftp-permissions-error/#findComment-110330 Share on other sites More sharing options...
DannyTip Posted October 20, 2006 Author Share Posted October 20, 2006 I guess ill have to create the directory via ftp using php instead. Link to comment https://forums.phpfreaks.com/topic/24265-php-mkdir-ftp-permissions-error/#findComment-112048 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.