error permission not permitted |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Zymic Free Web Hosting Zymic Free Web Hosting - General Discussion & Help |
||
error permission not permitted |
||
Sep 25 2007, 02:54 AM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 5 Joined: 21-September 07 Member No.: 367 |
Thanks,
Basically I was doing this on: http://gifs.zxq.net As you can see on the site I am keeping images, and I am having cautions to avoid porn or other abuse images uploaded by the users. Therefore I made a script to list down all and delete. But when I submit the page it gives me the error of "permission denied in xyz page", therefore I changed the chmod("filename",0777) then execute but now it gave me the error permission not permitted in this situation what I suppose to do. And I also chown("filename","user") but it is giving error that unable to find uid "user" 1st I have used my username and then the ftp username but on both I got this please help me as soon as possible as I have to complete this, its complete just this tasks remaining as during upload I am in same situation which is basic for my site. Thanks, Najm. |
|
|
![]() |
Sep 25 2007, 02:21 PM
Post
#2
|
|
![]() Outrageously Uber Ninja ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrators Posts: 2,831 Joined: 11-March 07 From: UK Member No.: 9 |
There should be no reason to chown the file, the webserver runs via mod_php and file permissions assume that of the webserver (user 'vhostswww' and group 'vhosts'). Your username is completely virtual and the user does not exist in the *nix respect.
By chmoding it to '770' the group ftp users and web server is in should have access to writing to that file. I wrote a little test script: The ftp session (ncftp is my ftp client): CODE ncftp / > mkdir uploads ncftp / > chmod 770 uploads # drwxrwx--- 2 3448 vhosts 4096 Sep 25 15:36 uploads The creation: CODE <?php touch('./uploads/test.txt'); ?> The file write: CODE <?php $fp = fopen('./uploads/test.txt', 'w'); if($fp !== false) { fwrite($fp, 'Some content'); fclose($fp); echo 'Content written.'; } else { echo 'Error. Can not open file pointer.'; } ?> This went without a hitch, the contents of that file being 'Some content'. Directory listing was also fine: CODE $dir = opendir('./uploads'); while($file = readdir($dir)) { if($file == '.' || $file != '..') continue; echo $file, "\n"; } So there is no need to chown or chmod inside of your script, providing the directory / file has sufficient permissions it will write to it, and you'll be able to list the contents. |
|
|
Najm-ul-Abideen error permission not permitted Sep 25 2007, 02:54 AM
Najm-ul-Abideen I have attached the snapshot of my site,
See what... Sep 27 2007, 08:45 AM
Bread You won't be able to define an absolute path, ... Sep 27 2007, 01:52 PM
Najm-ul-Abideen Thanks, it really worked some how, but again there... Sep 27 2007, 07:19 PM
Najm-ul-Abideen today I tried to solve the issue, but I resolve th... Sep 28 2007, 07:47 PM
Bread Which directory are you trying to move from?
I ju... Sep 28 2007, 10:07 PM
Najm-ul-Abideen Thanks for the upload example I got your point, bu... Oct 1 2007, 10:51 AM
-- Dan -- Thanks for the upload example I got your point, bu... Jan 31 2008, 10:49 AM ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 24th May 2013 - 09:45 AM |