Category : exec

I try to run a Python script as a background process from PHP on Windows using exec() on this way: <?PHP $python = ‘C:UsersUseranaconda3python.exe’; $py_script = ‘C:wampwwwlabexsimple_test.py’; $py_stdout = ‘> temp’.session_id()."_std.txt"; $py_stderror = ‘2> temp’.session_id()."_stde.txt"; exec("$py_bg $python $py_script $py_stdout $py_stderror &"); The script called and worked correctly, but PHP still waiting for the script. I ..

Read more

I’m trying to call a Python script in a PHP file and pass a variable value from that script after pressing the submit button. I have it: index.php <html> <body> <form method="post"> <input type="submit"> </form> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { putenv("HOME=/"); exec(‘python test.py’); echo $x; } ?> </body> </html> test.py x = ‘ass’ Both ..

Read more

I know that error 127 means "not found" or "permission problem," but I’m running it from Docker, so maybe permissions should be different (that file IS executable). I know the file is found; it’s some file permissions or Docker setting problem. Help! My docker-compose.yml file contains this: php: build: context: . dockerfile: php.dockerfile container_name: php ..

Read more

hello i am trying to use this library https://www.npmjs.com/package/torrent-stream-server as u can see the command to run it is to use torrent-stream-server serve however if i close ssh it stops working i tried doing shell_exec("torrent-stream-server serve"); in my php script but it is not working i also tried doing pm2 start torrent-stream-server but it didnot ..

Read more

I am trying to run the following NodeJS script to create a connection to a MySQL database and perform a few tasks: var mysql = require(‘mysql’); var con = mysql.createConnection({ host: "url", user: "xxx", password: "yyy", database: "zzz" }); con.connect(function(err) { if (err) console.log(err); else console.log("Success"); }); When this script is run from an Ubuntu ..

Read more