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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:09:39+00:00 2026-05-16T07:09:39+00:00

I have a classifieds website, and when users post a new classified, they may

  • 0

I have a classifieds website, and when users post a new classified, they may chose to upload images.

My php code takes the chosen image, uploads it to a image folder, and names it accordingly.

The problem here is, I have to set the images folder to 777 in order for this to work.

My question is, what should the permissions be set to? And any ideas why it is not working if not 777?

If you need more input just let me know…

Thanks

UPDATE

I have a user (danny) which has root access…
The folder where images are uploaded to, as well as the “image_upload.php” file which does the magic, are owned by user “danny”. Then I just tried setting them to chmod 764, but when I do that I get a problem.

See, it seems that I HAVE to set r+w+e permissions for the “public” for everything to work.

Can’t figure out why…

Thanks again

  • 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-16T07:09:40+00:00Added an answer on May 16, 2026 at 7:09 am

    Forget Revelations, 777 is the true number of the beast 🙂

    You should almost never need to set permissions that way. Surely your images are being created in the directory under a single user ID like php.

    If that’s the case (and it should be), you just need to add that user to the specific group of that directory and allow group write access, 764 most likely, though the last digit may change based on other needs.

    You can probably figure out which user is running by changing the upload script to do:

    system ("id >/tmp/id.txt")
    

    or whatever the equivalent is in PHP for running a command line tool.

    Then check the /tmp/id.txt file for the details. You’ll have something like:

    uid=1000(php) gid=1000(phpgrp) groups=1000(phpgrp)
    

    Once you find that out (php), work out the group of that images directory:

    pax> ls -ald images
    drwxr-xr-x 4 pax paxgrp 4096 2010-06-14 16:38 images
    

    That would be paxgrp from the above transcript. Then ensure that the php user is added to the paxgrp group. This can usually be done in /etc/group by changing, for example:

    paxgrp:x:1027:bob,george
    

    into:

    paxgrp:x:1027:bob,george,php
    

    then ensure the directory permissions allow group (but not world) writes.


    And, based on your update, it doesn’t actually matter who owns your PHP file, just who’s running it, and that may not be danny at all.

    Otherwise, I could remove any file on the hard disk because rm is owned by root 🙂

    The quickest way to find that user out for certain is to change that file so that it outputs the id information as I suggested.

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

Sidebar

Related Questions

I have a classifieds website... When users post a new classified, it is automatically
I have a classifieds website, and when posting a new ad, users may chose
I have a classified ad website. Users may put classifieds in, and each category
I have a classifieds website, and when posting a new classified users fill out
I am fairly new to sessions. I have a classifieds website, and users may
I have a classifieds website where users may sell/buy just about anything... My issue
I have a classifieds website where users may insert ads. There is a insert-ad
I have a classifieds website where users may search ads. I wonder if I
I have a classifieds website... Each classified is displayed in a php page called
I have a classifieds website, and users may for example search for cars. When

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.