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

  • Home
  • SEARCH
  • 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 8116927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:59:07+00:00 2026-06-06T03:59:07+00:00

My code gets a permission denied error at the move_uploaded_file() function when I’m trying

  • 0

My code gets a permission denied error at the move_uploaded_file() function when I’m trying to save a file into a folder on my server (from the temp folder).

My user has full permissions across all the website directories and files. Is there an apache user that need permissions as well? How do I give permissions to this apache user?

If that isn’t the case. Is there a way I can use the php chmod function to fix this problem?

Thanks for the help!

  • 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-06-06T03:59:09+00:00Added an answer on June 6, 2026 at 3:59 am

    You are correct. The folder you need to move the file to doesn’t need you to have permissions, it needs for the web server to have permissions.

    Basically you need to figure out what account your web server is running as and give that user write permissions to the destination directory.

    To figure out what your web server account name is, try the following command (assuming you’re running Linux):

    sudo lsof -i tcp:80
    

    You should get back a bunch of lines with a USER column. One will be root, ignore that one. The other user listed is the user under which your web server is running. It’s probably something like www or www-data or apache or the like.

    After that, navigate to the parent directory of your upload directory and change it’s ownership and permissions with the following command:

    sudo chown www-data:www-data uploads
    sudo chmod u+w uploads
    

    At that point, your webserver user now has access to write to your uploads directory. If you have any trouble, post a comment and I’ll try to help out.

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

Sidebar

Related Questions

My code gets the CA1303 warning from Microsoft.Globalization , "Do not pass literals as
The following code gets a JSON object and then spits its contents out into
I have a function that sending a code gets a description through various formatings,
I am getting the java.lang.SecurityException: Permission denied: file:////Videos/public/scripts/screenshot.jar when I try to use an
Trying to setup a Cron task that gets a file via FTP however seems
i'm having the the post's title error when trying to write a file on
This code gets html data and should replace all javascript content $.ajax({ url: url,
Following code gets executed whenever I want to persist any entity. Things seems to
The following code gets a 'report line' as an array and uses fputcsv to
I am developing on Eclipse on Windows and Code gets deployed on Unix. I

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.