Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 02-26-2007, 07:51 AM   #1
LQ Newbie
Registered: Feb 2007
Posts: 3

Rep: Reputation: 0
Executing system commands in a php script

I have a php script in which i am executing some shell commands (e.g date, who, ping, shutdown etc) using the System command. When I run the script from command line, every thing goes fine because I have the root privileges.
But if I run the script from web browser, only those commands are executed which don't need root privilages.
How to fix it?
It might be insecure but at the moment, I am not concerned about security.

Old 02-26-2007, 08:14 AM   #2
Registered: Sep 2006
Location: Silesia
Distribution: Debian GNU/Linux 4.0, ArchLinux, OpenBSD
Posts: 190
Blog Entries: 2

Rep: Reputation: 31
Maybe it will work when running those commands by sudo ?
Old 02-26-2007, 09:45 AM   #3
LQ Newbie
Registered: Feb 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Originally Posted by avallach
Maybe it will work when running those commands by sudo ?
No it doesn't work.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron not Executing PHP script Badnoodles Linux - General 2 10-25-2006 04:56 PM
Executing shell commands through PHP!!! Richtown Linux - Newbie 6 04-12-2006 02:57 PM
Executing UNIX command from PHP script ckoniecny Programming 3 03-01-2006 10:42 PM
Executing PHP script- error message vfulco Linux - Newbie 3 07-13-2004 10:55 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration