[PHP] mkdir() failed: Permission denied

2002-09-28 Thread Phil Powell

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




RE: [PHP] mkdir() failed: Permission denied

2002-09-28 Thread John W. Holmes

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:[EMAIL PROTECTED]]
 Sent: Saturday, September 28, 2002 3:38 PM
 To: [EMAIL PROTECTED]
 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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir() failed: Permission denied

2002-09-28 Thread Phil Powell

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 [EMAIL PROTECTED]
To: 'Phil Powell' [EMAIL PROTECTED]; [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
  Sent: Saturday, September 28, 2002 3:38 PM
  To: [EMAIL PROTECTED]
  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





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir() failed: Permission denied

2002-09-28 Thread Sascha Braun

I've made many dirs:

$path_to_dir = '../';
  $images = 'images/';
  $year = date('Y').'/';
  $month = date('m').'/';
  $source = 'jpg/';
  $thumbs = 'thumbs/';
  $preview = 'preview/';
  $files = $HTTP_POST_FILES['image'];
  $path = $path_to_dir.$images.$year.$month.$source;
  if(!file_exists($path_to_dir.$images.$year)) {
   mkdir($path_to_dir.$images.$year, 0755);
   if(!file_exists($path_to_dir.$images.$year.$month)) {
mkdir($path_to_dir.$images.$year.$month, 0755);
if(!file_exists($path_to_dir.$images.$year.$month.$source)) {
 mkdir($path_to_dir.$images.$year.$month.$source, 0755);

But you need to be the owner of the dir where you want to create another dir
and the permissions have to allow you to make some dirs.

The abowe script doesn't work unless you close the if () { constructs.


 Ok, I'm confused.. tell me how to make a directory, please.

 Phil
 - Original Message -
 From: Sascha Braun [EMAIL PROTECTED]
 To: Phil Powell [EMAIL PROTECTED]
 Sent: Saturday, September 28, 2002 3:53 PM
 Subject: Re: [PHP] mkdir() failed: Permission denied


  You have to be the owenr too and maybe set the permission to 755.
 
 
   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
  
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] mkdir() failed: Permission denied

2002-09-28 Thread John W. Holmes

_YOU_ don't need write permissions, the web server does

---John Holmes...

 -Original Message-
 From: Phil Powell [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, September 28, 2002 4:24 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
 To: 'Phil Powell' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 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:[EMAIL PROTECTED]]
   Sent: Saturday, September 28, 2002 3:38 PM
   To: [EMAIL PROTECTED]
   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
 
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mkdir() failed: Permission denied

2002-09-28 Thread Phil Powell

Got it but the solution is derned freaky... talking to the webserver admin I
come to find out that I have to write a stub executable to php4.cgi which
will interpret the PHP script bypassing the Apache mods.. that way I can
keep the directories at the default 0755 and STILL be able to do file mkdir
and uploading!!

Phil

- Original Message - 
From: John W. Holmes [EMAIL PROTECTED]
To: 'Phil Powell' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, September 28, 2002 7:04 PM
Subject: RE: [PHP] mkdir() failed: Permission denied


 _YOU_ don't need write permissions, the web server does
 
 ---John Holmes...
 
  -Original Message-
  From: Phil Powell [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, September 28, 2002 4:24 PM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  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 [EMAIL PROTECTED]
  To: 'Phil Powell' [EMAIL PROTECTED]; [EMAIL PROTECTED]
  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:[EMAIL PROTECTED]]
Sent: Saturday, September 28, 2002 3:38 PM
To: [EMAIL PROTECTED]
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
  
  
  
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] MkDir failed (Permission denied)

2001-03-10 Thread Dan Pupek

I am pretty new to PHP but have used other scripting languages. I am trying
to use to mkdir() function on an apache server and keep getting this  error
MkDir failed (Permission denied). I don't have physical access to the
server.

What's up?

Thanks in advance for any help.
Dan Pupek

On the Web:
http://www.sunnet.net/dnkp/dan

Email:
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MkDir failed (Permission denied)

2001-03-10 Thread Colin May

Quoting Dan Pupek (Sat, Mar 10, 2001 at 02:49:40PM -0600)
 I am pretty new to PHP but have used other scripting languages. I am trying
 to use to mkdir() function on an apache server and keep getting this  error
 MkDir failed (Permission denied). I don't have physical access to the
 server.
 
 What's up?

Depends what directory you are trying to create, and if the permissions of 
the parent directory allows you to do, based on the user apache is running 
as.  Usually, most people dont run apache as root, normally the "nobody" 
user.   "nobody" tends not to be able to mkdir's unless someone has 
chown'd/chmod'd a parent directory accordingly.

Colin. 

-- 

Colin May  | "its an illusion, its a game, a reflection of
mailto:[EMAIL PROTECTED]  | someone elses name" - abacab, genesis
http://www.wibble.org.uk   | http://www.abacab.org.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]