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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:48:05+00:00 2026-05-31T08:48:05+00:00

This seems to be a common problem, but I can’t seem to find the

  • 0

This seems to be a common problem, but I can’t seem to find the exact answer I’m looking for.
I’m running XAMPP on OSX, and in my web app am trying to allow an admin to create a directory if none exists for a new year. So, under htdocs/mywebapp/images, if a directory doesn’t exist for, say, 2012, then mkdir() and begin uploading files to that directory.

Running ls -l from the mywebapp directory shows that the images directory is created as

drwxr-xr-x   18 myusername  admin    612 Feb 12 17:32 images

so the first thing I tried was

sudo chmod 0775 images

which didn’t help. Looking at the httpd.config file shows that the user/group is defined as www:www so I tried changing the owner/group to that:

sudo chown www:www images

which results in, as expected:

drwxrwxr-x  18 _www      _www     612 Feb 12 17:32 images

but, again, I get the Permission denied error. So, I’m at a loss as to what my next step is.
The php code I’m using to get to this point is here:

$directory_self = dirname(__FILE__);
$base_image_path = $directory_self . '/images/'; // outputs "/Applications/XAMPP/xamppfiles/htdocs/mywebapp/images/"
$year = '2012';
$image_path = $base_image_path . $year . '/'; // outputs "/Applications/XAMPP/xamppfiles/htdocs/mywebapp/images/2012/"
if(!file_exists($image_path)){
    mkdir($image_path, 0775);
}

Thanks for your 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-05-31T08:48:06+00:00Added an answer on May 31, 2026 at 8:48 am

    try to check real process owner:

      $processUser = posix_getpwuid(posix_geteuid());
      echo($processUser['name']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems like this is a common problem, but I can't seem to find
This seems to be a common problem but I cannot find a solution. I
This seems like a simple question, but I can't find it with the Stack
It seems this must be a common scheduling problem, but I don't see the
This seems like a very simple and a very common problem. The simplest example
This seems like it would be a common issue to be but I don't
This may be something common and trivial, but I seem to be having trouble
I have a common problem but the common solutions seems don't work for me.
This seems to be a very common problem of mine: data = [1 2
I know this must be a pretty common problem, but I haven't been able

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.