web-console icon indicating copy to clipboard operation
web-console copied to clipboard

$HOME_DIRECTORY not working

Open 0x2F opened this issue 10 years ago • 4 comments

I've setuped my $HOME_DIRECTORY = '/home/nix/';

This is the usage example :

login: nix password: ***** You are authenticated [email protected] /home/nix/$ ls Unable to change directory to current working directory, updating current directory [email protected] /usr/share/nginx/html$

0x2F avatar Jun 19 '15 12:06 0x2F

Make sure that directory $HOME_DIRECTORY (/home/nix/) exists and user running the Web Console have permissions for CD to that directory. To identify user running the Web Console you can run id command in Web Console. Also, try to run following commands in Web Console cd /home/nix/ and after that ls, what output you see?

nickola avatar Oct 09 '15 11:10 nickola

I have the same problem. cd doesn't move the current directory

login: root password: ****** You are authenticated root@MLERMAN-LAP C:\UniServer\www\mlscript$ echo %cd% C:\UniServer\usr\local\apache2 root@MLERMAN-LAP C:\UniServer\www\mlscript$ cd .. root@MLERMAN-LAP C:\UniServer\www$ echo %cd% C:\UniServer\usr\local\apache2

but it changes the string in the prompt correctly.

mlerman avatar Mar 29 '16 21:03 mlerman

I found one issue. The command is not running in the context of the current directory

It needs this change

$cwd = getcwd();
$process = proc_open($command . ' 2>&1', $descriptors, $pipes, $cwd);

in the function execute_command

mlerman avatar Mar 30 '16 00:03 mlerman

Now you can pass the home directory via the get variables.

$HOME_DIRECTORY = ''; if (isset($_GET["HOME_DIRECTORY"])) { $HOME_DIRECTORY=$_GET["HOME_DIRECTORY"]; }

mlerman avatar Mar 30 '16 00:03 mlerman