I have downloaded a library from GitHub to run shell commands from within a PHP script. It works like this:
$process = new Process("su - {$login}");
$process->put($password);
$process->put("\n");
$process->put($command);
$process->put("\n");
$data = $process->get();
$process->put("exit");
$process->put("\n");
It is based on proc_open()
. I use it on my localhost
with my Linux login and password and everything works fine. I want to use this library on a web server. I wanna try 'www-data'
as login but have no idea what to pass as www-data's
password. What to use as login to allow users use this library on real web server, not localhost?
(I posted this to stackoverflow but they downvoted it adding that it is not about programming and more about server fault)