开发者

How to connect as linux root user in php [duplicate]

This question already has answers here: 开发者_StackOverflow中文版 Closed 11 years ago.

Possible Duplicate:

How to run PHP exec() as root?

Hey Guys,

I need to connect the linux root user in php.

i hosted my file in var/www/html/connect.php

I need to execute one shell_exec script. It says it "Only root user can login".

How can i change that? or Please help me to sort the problem.


Usually php/apache executes the php files using the www-data user. if you need to execute your shell, all you need to do is to give the corresponding permissions to www-data for that file using chmod


you need to give apache (or whatever is running php) sudo rights to the server, than you can run as root, bu doing:

sudo command
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜