RE: [PHP] mkdir() failed: Permission denied
| From: | John W. Holmes | Date: | Sat, 28 Sep 2002 23:04:37 +0000 |
| Subject: | RE: [PHP] mkdir() failed: Permission denied | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117994@lists.php.net to get a copy of this message | ||
_YOU_ don't need write permissions, the web server does....
---John Holmes...
> -----Original Message-----
> From: Phil Powell [mailto:soazine@erols.com]
> Sent: Saturday, September 28, 2002 4:24 PM
> To: holmes072000@charter.net; php-general@lists.php.net
> Subject: Re: [PHP] mkdir() failed: Permission denied
>
> Ok I did just that.. Permission is set for /users/ppowell/web/my at
0755
> giving me full write permissions onto that directory, I would think,
to
> create subdirectory /images.
>
> However, I can't do that because I get the following error:
>
> on line 27:
> if (!is_dir($path)) mkdir($path, 01755);
>
> // $path = "/users/ppowell/web/my/images/";
>
> Warning: Unable to access /users/ppowell/web/my/images/ in
> /users/ppowell/web/my/process.php on line 27
>
>
>
>
> Phil
> ----- Original Message -----
> From: "John W. Holmes" <holmes072000@charter.net>
> To: "'Phil Powell'" <soazine@erols.com>;
> <php-general@lists.php.net>
> Sent: Saturday, September 28, 2002 4:22 PM
> Subject: RE: [PHP] mkdir() failed: Permission denied
>
>
> > Whatever user your web server is running as needs to have permission
to
> > write to that directory that you are trying to make the new one in.
> >
> > ---John Holmes...
> >
> > > -----Original Message-----
> > > From: Phil Powell [mailto:soazine@erols.com]
> > > Sent: Saturday, September 28, 2002 3:38 PM
> > > To: php-general@lists.php.net
> > > Subject: [PHP] mkdir() failed: Permission denied
> > >
> > > Ok, I am stuck. I am trying to create a folder in the same
directory
> > as
> > > process.php and then use
> > move_uploaded_file($FILES['myImage]['tmp_name'])
> > > and it constantly fails:
> > >
> > > mkdir() failed (Permission denied)
> > >
> > > Here is my code:
> > >
> > > <?
> > > $willChangeLayout = 1; $isEmptyLayoutValues = 1;
> > >
> > > foreach ($_POST as $key => $val) {
> > > if (strcmp($key, "isDefaultLayout") == 0) $willChangeLayout =
0;
> > > if (!empty($_POST[$key])) $isEmptyLayoutValues = 0;
> > > ${"$key"} = $val;
> > > }
> > >
> > > // SERVER-SIDE VALIDATION
> > > if ($willChangeLayout && $isEmptyLayoutValues)
> > > header("Location: " . $refURL . "?errorMsg=" .
urlencode("Please
> > fill
> > > out
> > > all required fields"));
> > >
> > > // FILE UPLOAD HANDLING
> > >
> > > $attempt = mkdir("/users/ppowell/web/my/images", 0655);
> > >
> > > if (is_uploaded_file($_FILES['myImage']['tmp_name']))
> > > move_uploaded_file($_FILES['myImage']['tmp_name'],
> > > "/users/ppowell/web/my/images/" .
> > > $_FILES['myImage']['name']);
> > >
> > >
> > > ?>
> > >
> > > Please someone tell me what I'm doing wrong :(
> > >
> > > Thanx
> > > Phil
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >