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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.