Exec functions with php

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Exec functions with php

Post by egami » Fri Dec 14, 2012 8:53 am

Two things to remember.

1. If you're trying to run a shell argument from the webserver, the shell is being run as "apache" or "nobody" depending on your distro..

Thus, you'll need to make sure that this user has sudo privis in order to run the commands in question.

2. When you run the PHP script in your shell, it's running as you, and will have completely different permissions.

You can see all of this by doing tail -f /var/log/http/errors.log

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests