RE: [PHP] exec / mkdir question

From: Date: Mon, 12 Aug 2002 19:02:38 +0000
Subject: RE: [PHP] exec / mkdir question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-112188@lists.php.net to get a copy of this message
Just curious, any reason you don't use the mkdir function/ mkdir ("/path/to/my/dir", 0700); -Brian > -----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 >

« previous php.general (#112188) next »