Re: Exec() wont run program
| From: | Curt Zirzow | Date: | Fri, 10 Oct 2003 21:01:55 +0000 |
| Subject: | Re: Exec() wont run program | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165793@lists.php.net to get a copy of this message | ||
On Fri, 10 Oct 2003 13:24:49 -0700, Steve <csufsurfer@yahoo.com> wrote:
I want to start up a program through a php page. For example, gedit. I found that the user is apache by running this: - passthru('whoami'); since apache might not have access to run a certain command, I'll use sudo. I edited the sudoers file in /etc/sudoers and underneath the line: # User privilege specification, I added: apache ALL=(ALL) NOPASSWD: ALL which would give apache access to run any command without a password. So in my php file the line looks like this: exec("sudo gedit");What is gedit? it looks like the gnu text editor command. most X applications wont run from the webserver in most cases.
And it doesn't do anything. Any suggestions.echo shell_exec("sudo gedit"); might give some answers, Curt.