Re: ftp root dir?

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

 



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?

-- 
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