2
The processes run by php shell_exec() end up restarting apache. It is possible to keep processes active without interruptions when restarting apache?
Below the code I’m using:
$Command = "ksh -c '( trap \"\" 1 2 3 4 15; ";
$Command .= "./sc_serv /caminho-do-conf/sc_serv.conf";
$Command .= " > /dev/null )' & echo $!"." ;";
$ExecCommand = $Command;
echo "Comando Executado: " . $ExecCommand ;
$Result = shell_exec($ExecCommand);
echo "<pre>$Result</pre>";
This alternative is very good @Alessandro and I’m using it at the moment, but I’m having a security problem since I haven’t found a way to run it without having to put the user and root password in the script. I’m doing a lot of research on this. There is a way that would add a "permission" in the /etc/sudoers for password-free access, but so far I have not been able to run phpseclib this way and without the use of password.
– anderson