Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Using PHP to execute a shell script, ...and I've got it half-working.
Westie
post Mar 4 2008, 06:19 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 4-March 08
Member No.: 13,363



I'm in the process of making a game control panel for my game-server, and part of that is making a PHP script that can kill process ID's. (Yup... I am aware of the risks.)

I'm using this code as a basis:
CODE
<?php
    echo `gtaserver kill westie`;
?>


where the result (as it should be) is this:
CODE
Server for westie has been shut down. (PID: 9340)


There seems to be a wee problem. If I use the gtaserver in PuTTY, it would kill the game-server, but if I try in PHP, it won't kill it. Nice.

I had a check with exec('whoami') and the user/group for apache is nobody.

So how would I go about getting this to work/giving apache the permission to use this?
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
DS2K3
post Mar 7 2008, 06:29 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,284
Joined: 14-November 04
From: Southampton, Hampshire
Member No.: 4,165



You could create a different user to run Apache under, then give that user necessary permissions. I think I added my Apache user to the list of sudoers (no password required) so that it cold access certain log files - You could try something similar.


--------------------
Fixed your problem? Let us know!
richard@linuxhelp.net

www.Gathr.co.uk Online Event Management
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2017 - 04:43 PM