Exec functions with php

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

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

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