I get a PHP string from the frontend and I just want to execute it and get the stdout and stderr.
This is what I tried:
const runner = require('child_process');
runner.exec('php ' + phpString, (err, stdout, stderr) => {
// ...
});
but this requires the PHP code to be in a file because it needs the path as an argument which leads to a PHP file. But writing the phpString to a file and then executing it seems unnecessary so is there a way I can directly execute the string?