Page 1 of 1
File Descriptor
Posted: Tue Jul 26, 2005 9:56 am
by radar
Response: 550 Could not change perms on /sig/Aeus.png: Bad file descriptor
I beleive that PHP is causing this error because it is first creating the file under a user which is not the same user as the FTP. What would I have to do, besides making the FTP user the same as the PHP user, to fix this error?
File Descriptor
Posted: Tue Jul 26, 2005 10:43 am
by ner0
If I\'m reading this right, you\'re getting the error in your FTP client?
If it is the user thing which is the problem (the error could also be other things though I\'d imagine), try just chown\'ing (changing ownership) of the file right after you\'ve created it with PHP.. something like:
[code]<?php
chown("filename",user);
?>[/code]
if you don\'t have access to chown it to that user, try chmod.. you could tweak the settings to allow reading/writing/execution by user/group/others.. but just to see if chmod is the problem you could try:
[code]<?php
chmod("filename",777);
?>[/code]
777 basically means accessible by user/group/others for reading/writing/execution.
hope this helps, by the looks of the error it could be a number of things.. good luck <img src=\'
http://www.killanet.net/forum3/public/s ... >/good.gif\' class=\'bbc_emoticon\' alt=\'(Y)\' />
File Descriptor
Posted: Tue Jul 26, 2005 1:10 pm
by radar
The files work now. Thanks for the tips
File Descriptor
Posted: Tue Jul 26, 2005 4:44 pm
by Scott
Picking up on ner0\'s chmod example, while using the decimal value would probably work most of the time, it is usually more correct to use the octal value. Hence, the above example becomes: [code]chmod("file", 0777);[/code]
Just more info for future reference <img src=\'
http://www.killanet.net/forum3/public/s ... /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' />
File Descriptor
Posted: Tue Jul 26, 2005 10:00 pm
by radar
[quote name=\'Vulture\' date=\'Jul 27 2005, 02:14 AM\']Picking up on ner0's chmod example, while using the decimal value would probably work most of the time, it is usually more correct to use the octal value. Hence, the above example becomes: [code]chmod("file", 0777);[/code]
Just more info for future reference <img src=\'
http://www.killanet.net/forum3/public/s ... /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' />
[align=right][post="26519"]<{POST_SNAPBACK}>[/post][/align][/quote]
I read the PHP helpfile on chmod() after reading ner0's post and that also told me to use the octal value.
File Descriptor
Posted: Wed Jul 27, 2005 9:29 am
by ner0
lol, I should have really checked the php help, I\'m just so accustomed to using a terminal where its just \"chmod 777 filename\", also works without octal... thanks for the correction