I would like to know a way to send files to a VPS via SSH with PHP! Could someone suggest me a help, as I'm on a gaming server, it has an internal database.
When registering the user, send the file to vps via SSH.
I would like to know a way to send files to a VPS via SSH with PHP! Could someone suggest me a help, as I'm on a gaming server, it has an internal database.
When registering the user, send the file to vps via SSH.
Use the PHP Shell_exec function, see the example below:
<?php
$output = shell_exec('scp <path/arquivo> <user@servidor>:</path/to/>');
echo "<pre>$output</pre>";
?>
Where:
path/arquivo = Path e nome do arquivo que vc quer enviar
user@servidor = Login do usuário e endereço do servidor q vc quer enviar
/path/to/ = Path no servidor para o qual vc está enviando
Note:
For this script to run your machine and the user must be authorized on the server.