Gossamer Forum
Home : General : Internet Technologies :

PHP Superuser

Quote Reply
PHP Superuser
I am trying to write a script that will create a fill and then change the ownership to someone else. However, I keep getting an error (using the chown function) and I am guessing it is because PHP is not running as a superuser. Does anyone know how to set PHP to run as a superuser? Or any other suggestions which may get this working? Thanks for the help!
Quote Reply
Re: [Lee] PHP Superuser In reply to
Is that a good idea? It would open up a *huge* security risk in your server :-/

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Lee] PHP Superuser In reply to
What error message are you getting? Can you post your code, please?

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] PHP Superuser In reply to
I wasn't even aware that you could CHOWN a file with PHP. mkdir(), chmod(), rmdir(), and other's, but not chown() Unimpressed

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] PHP Superuser In reply to
Yep - http://www.php.net/chown

But PHP does have to run with superuser permissions, which, I agree, creates some security concerns.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [Lee] PHP Superuser In reply to
Hi,

You would need to either:

a. Run apache as root (very bad idea and apache won't let you do this unless you recompile it with a special flag).

b. Run your PHP via CGI that is setuid root. Could be a big exploit waiting to happen if you don't lock it down properly.

Cheers,

Alex
--
Gossamer Threads Inc.