Hello. There is a PHP script that executes the screen -S test337 via SSH, here it is:

 /* Соединение */ $connect = ssh2_connect($rows1['ip'], $rows1['sshport']); ssh2_auth_password($connect, $rows1['login'], base64_decode($rows1['password'])); $shell = ssh2_shell($connect); /* Выполнение команды */ fwrite($shell, 'screen -S test337'.PHP_EOL); /* Получение ответа */ $text = ''; while($buf = fread($shell,4096)) {$text .= $buf;}; echo '<br>'.$text; /* Закрытие соединения */ fclose($shell); 

The $rows1 stores data from SSH.
But the server gives an error:

 Cannot find terminfo entry for 'vanilla' 

Even if you just send a screen command, it will return the exact same error.
The server costs CentOS 6. *
Can you please tell me how to fix this?
And why can it even happen?

    1 answer 1

    You can correct the error by setting the TERM environment variable to a more common (and therefore more likely to be present in the target system) value. for example, xterm , or even vt100 .

    Supplement the screen program call by assigning the value of the TERM variable:

     TERM=xterm screen ... 

    or so:

     TERM=vt100 screen ...