suexec and include files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

suexec and include files

Post by alex.barylski »

I'm curious, when a script runs under suexec, say as user root...

When that instance of the application includes other PHP scripts, which are of user 'apache' do those scripts run under root or apache?

Basically I'm curious as to whether I could run a index.php script as user 'something' and include other files under the user 'apache' and not worry about the included script files having the same access privies as the primary invoked script.

Cheers,
Alex
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: suexec and include files

Post by Eran »

The files might be owned by any user, they will be run as the user declared for the suexec. If you run it as root, then all includes will be run as root as well.

http://httpd.apache.org/docs/2.0/suexec.html
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: suexec and include files

Post by alex.barylski »

Thats what I figured...doh! Ah well...
Post Reply