php - Which enviroment variable specifies current path? -
php - Which enviroment variable specifies current path? -
i'm communicating debian computer via ssh2 php extension. (not well) documented function ssh2_exec states it's 4th argument is
an associative array of name/value pairs set in target environment.
i want operate upon different path ~
perform ls
on other directories (as making communication more comfortable). should set?
ssh2_exec($connection, "ls", null, array("???" => "/var/www/"));
none of them. current path part of process state, not environment. shells utilize pwd
environment variable indicate current path is, has no special meaning — setting won't anything.
if want list contents of path isn't home directory, pass argument ls
:
ssh2_exec($connection, "ls $path");
if need run command care working directory, utilize cd
:
ssh2_exec($connection, "cd $path; command");
php ssh debian
Comments
Post a Comment