0

I am unable to execute commands (shell_exec) with php, and read on stackoverflow / here that the solution was to run apache as root. Is this possible / is this a totally wrong solution? When I try to execute commands with php it does nothing. I am trying to run a python script with variables from a PHP script and it is not working, it does nothing. Doing this on a centos vps

ccwd4
  • 3
  • 1

1 Answers1

1

Standard builds of Apache don't tend to support running the httpd deamon as root. Typically (for RHEL and CentOS anyway) it runs under the apache account.

What you could do, if you're wanting to run your scripts from PHP as a root user, it add apache to the sudoers file. This will allow the apache account to impersonate the root user.

cpjones44
  • 160
  • 2
  • 8