Jump to content

Changing the group of a folder created by PHP (using mkdir)


willo_the_wisp

Recommended Posts

Hi,

I've written a script for a client which creates a folder on the server using mkdir. The client wanted this folder to be created for them (don't ask why, it's complicated!), then they wanted to be able to FTP in and add files into the folder using FTP.

The problem is that the script creates the file with a group of 99. When the client tries to FTP in and add their files, they get the following error: '550 Can't create directory: Permission denied', presumably because they're in a different group.

What I need to be able to do is get the script to create a folder with a different group, so that my client can FTP their files into it.

I thought I would be able to use PHP's chgrp after mkdir, as follows:

mkdir($filepath, 0777)

chgrp($filepath, 501);

 

However then I get "Warning: chgrp() [function.chgrp]: Operation not permitted". I realise from reading the manual that I need to be a superuser to do this, which my web script obviously isn't.

My question is, how can I get around this? Is there some setting in Apache that I can set?

 

Thanks in advance for any help!

 

Willo

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.