Re: ftp root dir?

From: Date: Thu, 24 May 2007 23:57:27 +0000
Subject: Re: ftp root dir?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-255607@lists.php.net to get a copy of this message
On Tue, May 22, 2007 9:50 am, Al wrote: > Can I assume that all ftp_connect()s will make the current dir the > DOC_ROOT? Probably not. If I FTP connect to *my* webhosted servers, I'm put into a directory which contains 'www' and 'php' and 'private' which are set up by the host for 'DOCUMENT_ROOT' 'include_path' and 'openbase_dir' respectively, as well as any other directories/files I chose to add there. It all depends how FTP and www server are configured, and they are not tied at the hip by any means. > If not, how can I insure the ftp root dir is the same as DOC_ROOT? You'll have to ASK the user to config their own account to map things up, I guess... > You can't use the absolute path with ftp. Again, depends on FPT server and setup -- Some FTP setups accept an absolute path and allow the FTP user to start at the '/' box root directory, but not all the time. > chdir() doesn't change the ftp current dir. No, it changes the directory on your PHP server box. > if you ftp_chdir() and it's already on the root, it posts an error. You should be able to catch that and get rid of it. > ftp_pwd() simply returns "/", which simply says it's on its root, > where ever that is. Yes. That is where it is. Unless it's been configured to not only have its own root, but also to change the user to a non-root directory upon login, which is also possible setup, especially when the user is allowed to run rampant all over hte box, and the FTP server relies on user/access permissions on the box to control access. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#255607) next »