Changing UID and GID

fobby

New member
Joined
Jan 6, 2007
Messages
2
How to I change the value of the UID and the GID ? Currently it is set to Apache, I need to set it to myUserID.

Thanks,

Whats the difference between UID and GID anyway?
 
If you are the server admin, you will need to ssh into the server and go into your user directory and chown the files in question to your user id.

If you are not the server admin, you will need to contact support for your hosting company and request that they do this for you.

Whats the difference between UID and GID anyway?
UID = User ID
GID = Group ID
 
how can I hard-code it inside a php script so that every directory the script creates it automatically change it to my userID??
 
Apache CLI?

All files/folders crated via php will be owned by apache
Then the php script should also chmod all its created files/folder to 666/777

Under multiple level of files/folders creation (since 2nd level) you may experienced permission problem via ftp.

Well-scripts will not do create folder,
it will require you to create that folder and chmod 777 via ftp and then it will upload the files under that folder in flatten level and then chmod to 777 then you can access/delete it via ftp


Apache CGI (suPHP)

PHP Script will execute under uid same as it's own uid
All files/folders created via php will be the same uid as script's owner

Not much webhosting run php in cgi mode due to it's increase cpu load.


For your question

Contact server admin to chown those files for you.
 
We have the same problem.
Any user when tries to upload an image or create a folder via PHP for example it gets the apache user and group and not users id.

It is not possible to chown files/folder as this needs to be done every time any user upload a file so cron is not useful for this.

Anyone with a suggestion?
 
Back
Top