Re: cannot make directory at remote host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I can make the files now after setting the permission to my images folder but I cannot delete the folder or images in it. I have tried unlink and rmdir with no success. Even with filezilla cannot delete it


The problem seems to be the images that are set to chmod of 600 and cannot be changed. I upload the file with this

move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $img_url)

is there a way to set the permissions of the images on upload to anything other than 600?

R.




From: "Chris" <dmagick@xxxxxxxxx>
To: "blueboy" <ross@xxxxxxxxxxxxx>
Cc: <php-general@xxxxxxxxxxxxx>
Sent: Thursday, June 07, 2007 12:08 AM
Subject: Re:  cannot make directory at remote host


blueboy wrote:
This work localy but not on my remote host. How can I debug it?

if(!(is_dir('images/$customer_id')))
{
mkdir("images/$customer_id", 0700);

}

The file is in the main public_html folder and there is a images folder.

First tip - always use full paths instead of local ones so you know *exactly* where it's going.

If it goes under the current folder (and I hope you have some basic checking here somewhere for customer_id):

$customer_id = (int)$customer_id;
if ($customer_id <= 0) {
  die("Bad customerid!");
}

$dir = dirname(__FILE__) . '/images/' . $customer_id;

if (!is_dir($dir)) {
  mkdir($dir, 0700);
}

What should the permissions be?

Depends on the host (whether they are running php in cgi mode or as an apache module).

Check if safe-mode is on or off.

Check the parent folder to make sure that the webserver user has write & execute access to be able to get into the base folder.

display errors and turn error reporting up to work out why it's not working.

--
Postgresql & php tutorials
http://www.designmagick.com/


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux