PHP and Permission/Ownership Issues

"Bad File Descriptor" Errors in FTP

*Note that this applies to servers running mod_php only*

As PHP applications are becoming more popular, we often come across issues where users are unable to access, edit, or remove their own files or folders. The reason for this is typically due to ownership and permission issues associated with the php user, "nobody." When you install a php program such as phpNuke, phpBB, Gallery, Joomla, etc. on your website, these files are created by the php programs, and are therefore owned by this virtual php user.

Just a basic rundown on permissions:

Every file and folder on your website has an owner, a group, and a set of permissions (read, write, and execute. Also, there are three categories of user type: the owner, the group, and the "world" (meaning; everyone else). So you can basically make a file writeable by the owner, but only readable by everyone else. By "owner" I am referring to the user who created the file. When dealing with PHP and everything else on your website you would consequently be dealing with two users: you (username) and the php user ("nobody").

This means that when a php program goes through the installation process, it is creating files owned by its user, "nobody." When you access your site via FTP or File Manager, you are accessing the files are your user, which is the username that you used to log in (userna5 or such). So then when you go into FTP and try to edit files for the php program, you'll find that you don't have permission because you are not the owner; "nobody" is. On the other side, when you upload a file in FTP and try to call it from the php program, that php program may not be able to read or edit it as well because -you- are the owner.

We most often see these problems with customers who use FrontPage or Dreamweaver, as they will try to edit php files and such in these programs and then try to upload them, then realize that they can't. That's because they will try to upload into one of the php directories, where the php user "nobody" will say, "Hey, that's MY file and you can't change it!" therefore giving you a lovely "Access Denied" message.

Our solution to this is to edit your website as usual, but use the provided administrative panel from your php's software to make any changes to your php program. For instance, if you have Gallery2 installed in a subdirectory on your website, you should log into the admin panel of Gallery2 to upload or make changes, while using FTP, Frontpage, etc. to make changes to the rest of your site. If you find it absolutely necessary to be able to access your php files through FTP or vice-versa, you would need to contact us so that we can make the necessary ownership changes.

Joomla and Mambo users: There is an FTP simulator that you can use to work around the permissions issue, called Joomla/Mambo Xplorer. Check out these links:

For Joomla:

http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,102/Itemid,35/

For Mambo:

http://www.remository.com/rem/Remository/Download/Mambo-Software/Selected-Mambo-components-from-elsewhere/MamboXplorer/

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!