Page 1 of 1
need help about accessing sevices of LINUX by PHP
Posted: Sun Aug 06, 2006 7:12 am
by tapas_bahirbag
i have faced a problem. the problem is following:
i can execute 'ls' by PHP in LINUX. But i can't access any service function since i am root useer by PHP. Can i access service functions of LINUX by PHP??? if i can, then how???
- tapas_bahirbag
Re: need help about accessing sevices of LINUX by PHP
Posted: Sun Aug 06, 2006 7:13 am
by Chris Corbyn
tapas_bahirbag wrote:i have faced a problem. the problem is following:
i can execute 'ls' by PHP in LINUX. But i can't access any service function since i am root useer by PHP. Can i access service functions of LINUX by PHP??? if i can, then how???
- tapas_bahirbag
If this is your own server then you can set PHP to run as the root user. If it's not your own server then we should not be helping you with this anyway

Posted: Sun Aug 06, 2006 7:23 am
by feyd
Why was this in Suggestions?
Re: need help about accessing sevices of LINUX by PHP
Posted: Sun Aug 06, 2006 7:24 am
by tapas_bahirbag
d11wtq wrote:tapas_bahirbag wrote:i have faced a problem. the problem is following:
i can execute 'ls' by PHP in LINUX. But i can't access any service function since i am root useer by PHP. Can i access service functions of LINUX by PHP??? if i can, then how???
- tapas_bahirbag
If this is your own server then you can set PHP to run as the root user. If it's not your own server then we should not be helping you with this anyway

yes. this is my server.
Posted: Sun Aug 06, 2006 7:27 am
by tapas_bahirbag
feyd wrote:Why was this in Suggestions?
sorry. i am a new user of this forum. after posting my problem i found that this is not correct place to post any problem.
Posted: Sun Aug 06, 2006 7:39 am
by timvw
Imho, executing PHP scripts as root is dangerous and usually plain overkill... Just make sure that the user that will execute the script has sufficient rights... (But not any more rights...)
Posted: Sun Aug 06, 2006 9:07 am
by Chris Corbyn
You can use PHP CGI with the apache suexec module to force PHP to run as root on a per-directory basis. Like timvw says it's a big risk though...