File Descriptor

Support, Snippets & Projects

Moderators: Moderator, Global Moderator

Post Reply
radar
Hero Member
Hero Member
Posts: 632
Joined: Thu Jun 17, 2004 12:37 am

File Descriptor

Post 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?
ner0
Hero Member
Hero Member
Posts: 982
Joined: Sat May 22, 2004 4:45 pm

File Descriptor

Post 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)\' />
[color=\"green\"]'class KPIM::ProcessManager' only defines private constructors and has no friends[/color] <- :( poor class



[18:09:00] * ~Moppy stews ner0 erotically 1 times.
radar
Hero Member
Hero Member
Posts: 632
Joined: Thu Jun 17, 2004 12:37 am

File Descriptor

Post by radar »

The files work now. Thanks for the tips
Scott
Administrator
Administrator
Posts: 1651
Joined: Sun Apr 25, 2004 1:08 pm

File Descriptor

Post 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=\':)\' />
radar
Hero Member
Hero Member
Posts: 632
Joined: Thu Jun 17, 2004 12:37 am

File Descriptor

Post 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.
ner0
Hero Member
Hero Member
Posts: 982
Joined: Sat May 22, 2004 4:45 pm

File Descriptor

Post 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
[color=\"green\"]'class KPIM::ProcessManager' only defines private constructors and has no friends[/color] <- :( poor class



[18:09:00] * ~Moppy stews ner0 erotically 1 times.
Post Reply

Return to “PHP &amp; MySQL”