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 8343533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:05:36+00:00 2026-06-09T06:05:36+00:00

I (PHP newbie) am setting up a legacy PHP website on my Linux/Apache server.

  • 0

I (PHP newbie) am setting up a legacy PHP website on my Linux/Apache server.

When I test the site in my browser I get this error:

Warning: move_uploaded_file(/var/tmp/jinfo/Circuit/best_cities.csv):
failed to open stream: Permission denied in /var/www/jinfo/includes/jinfo.inc.php on line 89 
Warning: move_uploaded_file(): Unable to move '/tmp/phpMLE9Ox' to
'/var/tmp/jinfo/Circuit/best_cities.csv' in
/var/www/jinfo/includes/jinfo.inc.php on line 89

Looks like a file system permissions problem. The script uses /var/tmp/jinfo and its subfolders to store files. The permissions on that directory are:

drwxr-xr-x 5 root root 4096 Aug  7 15:32 jinfo

Since Apache is running as user www-data, the error message is expected. But what should the permissions be? I am sure there are lots of ways to make the error message go away by loosening permissions, but I want to follow the best practice. Should I change the owner (chown) to www-data, or chmod the permissions?

Note: I need the changes to propagate to subdirectories too.

  • 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-09T06:05:37+00:00Added an answer on June 9, 2026 at 6:05 am

    You need to fix your permissions before changing the group will be effective. As mentioned in Explosion Pill’s answer, you should change the group to be www-data for Apache. You can do this recursively on your /var/www directory:

    chown -R owner:www-data /var/www
    

    where owner is the user that currently owns the files.

    Here you can see the read/write/execute permissions on the file for the owner, group, and others respectively:

    drwxr-xr-x

    Ignore the d, the other letters mean:

    • owner – read write execute
    • group – read —— execute
    • others – read —— execute

    This site gives you the meaning of the chmod numbers:

    http://www.goldenplanet.com/support/kb/articles/changing-of-file-rights-chmod-on-the-webserver.html

    0: No rights 
    1: Execute
    2: Write
    3: Write/Execute
    4: Read
    5: Read/Execute
    6: Read/Write
    7: Read/Write/Execute

    You can do chmod 775 on the directory that is giving the permission error which will give the owner of the file and the group full permissions, while only giving “others,” read and execute access.

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

Sidebar

Related Questions

Hey, PHP newbie here when I try to run this to get an IP
Hi i am a newbie to php and am following this tutorial http://tutorialpot.com/2011/06/fancy-contact-form-with-inline-validation/#comment-1771 i
Im a php/mySQL newbie and am trying to get the hang of it. I
I'm a fairly newbie php coder, got this php code in a tutorial to
I'm a PHP newbie, so I have a minor problem functions. I have this
I am a PHP newbie, and I have this question: say I have: a.php:
I'm calling a function like this: <?php print get_thumbnail('http://url.com/?skin=rss'); ?> Being a php newbie,
I'm a total newbie at PHP, but this seems so simple, there doesn't seem
PHP newbie here. I'm currently developing a shopping cart web site using PHP and
I'm a PHP-Newbie and want to create a simple Website to manage my CD

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.