A
A
alligator30002020-10-20 20:06:34
linux
alligator3000, 2020-10-20 20:06:34

How to run linux terminal command via php in browser?

I have a PHP script that calls a Python script in the terminal:

<?php
$output = shell_exec("python3 drel_on.py");
echo "<pre>$output</pre>";
?>

If you call it in the terminal, it works, but if you run it in the browser, the command is not executed. How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adamos, 2020-10-20
@Adamos

One option is to set up the webserver so that .php handles Puff and .py handles Python.
If this script really doesn't do anything else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question