Re: Re: How can I tell PHP what user to be?

From: Date: Wed, 16 Apr 2003 11:06:09 +0000
Subject: Re: Re: How can I tell PHP what user to be?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-144098@lists.php.net to get a copy of this message
> Give us more info as to system your are running PHP under The system is a virtual host that I pay for. In order to prevent users from doing anything naughty, it seems that anything safe mode can restrict is restricted -- this includes all version of shell_exec(). I am trying to automatically create a number of directories, and populate them with files. I.e, when a user signs up with username Bob, a directory called Bob will be created under /users/, and it will be filled with files. I have yet to find a workaround that actually works. PHP, on this system, has uid 538 -- but whenever it creates a dir it does it under uid 48. (In order to create this directory I had to use the FTP functions to ftp in and ftp_mkdir()). This means that the directory is not writable. I have tried to mix in a bash script -- but I am not allowed to use any shell exec commands (even ftp_exec()). This poses something of a problem. All these errors occur, because, as far as I can tell, on my server PHP is mixing and matching user ids. It cannot create directories in directories it does not own, but it owns no directories. Even when I do manage to get it to create a directory, it manages to do it under a completely different user id -- even when it ftps in! Chown does not work, nor does shell_exec()! So my question is, outside of finding a new service providor, how do I fix things? -Dan

« previous php.general (#144098) next »