Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6648801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:41:54+00:00 2026-05-26T00:41:54+00:00

I have a php script in user1’s directory, and I am getting permission denied

  • 0

I have a php script in user1’s directory, and I am getting permission denied when trying to open the directory of another user.

So the script is in

/home/user1/script.php

and I am trying to open

/home/user2/uploadedfiles/

This is in CentOS linux. I have used

chmod -R 777 /home/user2/uploadedfiles/

and confirmed that the permissions changes have taken effect by running ls -l. Don’t worry I wouldn’t leave it on 777, I have just tried that in an effort to get things working.

PHP script is:

opendir(/home/user2/uploadedfiles/)

Which returns:

[function.opendir]: failed to open dir: Permission denied

I want user2 to be able to FTP up some files, but did not want to give them access to user1’s folder which is where the site. So that’s why there are two accounts, and user1’s script is trying to get to the files user2 uploaded. Maybe I have this part wrong? Is there a better way to create a new linux account to FTP into a folder in user1’s directory, but not touch anything else?

Thank you! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:41:54+00:00Added an answer on May 26, 2026 at 12:41 am

    To be able to do anything with /home/user2/uploadedfiles/, user1 must be able to traverse through /home/user2 first.

    Set the execute bit (chmod ..+x) on /home/user2 (but not the read bit, which would allow listing the directory), and remove the read and write bits of /home/user2/* (sans uploadedfiles, of course).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to have a php script run when the user navigates away from
I am trying to have a php script that displays a url with user
I have a PHP script that creates other PHP files based on user input.
I have written php script for user login but instead of displaying the result
I have a PHP script being served over https:// that is trying to push
I have a php script which sends user a mail if his purchase is
I have a PHP script which sets a cookie called user. I need to
I have PHP script, which is requested by user. In this script I want
I have a php script, test.php that has the contents <?php require_once(classes/user.php); echo test;
I have a PHP script which is used to resize images in a user's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.