Shell Exec does not run opening by browser

Asked

Viewed 127 times

0

I made a list of commands to be executed on the server using php, which was as follows

echo shell_exec("sudo mkdir teste");
echo shell_exec("sudo chown apache:ind teste/");
echo shell_exec("sudo unzip image.zip -d teste/"); 

Running directly on the server with the command

sudo php -f teste.php

Everything that is inside the document runs, but if I try to run through the browser, for example

www.minhaurl.com/teste.php
  • Goes in the php.ini and looks for the line disable_functions, remove from the list the shell_exec.

  • No Rolou, still not running :/

  • I found this here https://stackoverflow.com/a/38523143/11379709 says you should add a rule so sudo doesn’t ask for the password for the page.

  • I guess it didn’t work either :/ How boring this is

  • How you are restarting the server after the changes?

  • sudo service named Restart, it worked the update, because I can no longer run by pronpt, but even so, it does not work by browser :(

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.