0

I have a php code that is supposed to run a command(python code) in linux (specifically ubuntu) The python code I have is the following:

import os
os.system("poweroff")

but.. when I run the php code that contains

shell_exec("python3 /var/www/html/main.py);

It doesn't works. My device doesn't shuts down.

Please can anybody help?

I have already tried running

exec("python3 /var/www/html/main.py);

but that didn't worked as well....

RPD_215
  • 13
  • 4
  • python script's command `poweroff` might be wrong , see here - https://stackoverflow.com/questions/34039845/how-to-shutdown-a-computer-using-python – Al-Amin Oct 28 '20 at 17:40
  • I have already seen those answers before posting my question.... And more over... When I run the python code from the terminal.. it works. Its just not working with PHP... Can you help about that? – RPD_215 Oct 29 '20 at 01:28

0 Answers0