Re: cannot make directory at remote host

From: Date: Wed, 06 Jun 2007 23:08:58 +0000
Subject: Re: cannot make directory at remote host
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-256253@lists.php.net to get a copy of this message
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/

« previous php.general (#256253) next »