RE: [PHP] exec / mkdir question

From: Date: Mon, 12 Aug 2002 20:37:31 +0000
Subject: RE: [PHP] exec / mkdir question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-112199@lists.php.net to get a copy of this message
// Create user directory /* $user-id is a variable that contains the use name from a form field, that's how I name my new directories, u can use whateve u want*/ mkdir ( "/path/to/dir/$user_id", 0755 ) or die ( "Could not create custom user directory." ); - Vic -----Original Message----- From: Simon Ritchie [mailto:spamsink@merrowinternet.com] Sent: Monday, August 12, 2002 2:50 PM To: php-general@lists.php.net Subject: RE: [PHP] exec / mkdir question > > i'm using the following code to create a directory :- > > > > $temp = exec("mkdir $path"); > > > > it doesn't work... > > > > i've validated the $path var which is correct. i suspect it is a > > permissions issue. > > > > what should i look for to resolve this? > > Try using the mkdir function: That is good practice, but if the problem is with the permissions, the program will just be better written when it fails. A note of the error message and some information about the host environment would help. However ... The user running the PHP script needs to be able to create the file. If this is a UNIX system and the web server is run by the user nobody, then that user needs write access to the directory which will contain the file. To grant that access, your user (the one you, er, use to connect to the server) must own the directory The worst case is when your user and the web server user are not in the same group. In that case, you will need to grant write access to all users. This introduces potential security risks - any user can also remove or rename files in that directory. Simon Ritchie Download my introduction to PHP for $25: http://merrowinternet.com/downloads?source=ml -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca

« previous php.general (#112199) next »