• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

URG: Need to write a php script which will install a package???

Hey guys,

Heres my situation(its worse)

How can i write a PHP script that will install an RPM on the server, if possible then how do i get the
output of that, meaning if i run rpm -i package name on the command prompt, it outputs everything on
screen how do i get this output in php too???

Any bit of a light on this darkness is appreciated...


thanx

kal
0
kaldude
Asked:
kaldude
1 Solution
 
CJ_SCommented:
I'm not a PHP guru but you can execute an application using PHP. There are a couple of methods, one I do know.

$soutput = shell_exec('yourcommand');
eche $soutput;

The output will be sent back as a string. Helps?

CJ
0
 
CJ_SCommented:
echo not eche :-)
0
 
CJ_SCommented:
If it does not work you should probably set permissions for the user accessing the machine. I have no idea how to do that :-) Except if the platform is NT.

CJ
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
kaldudeAuthor Commented:
hey CJ,

Thanx for all your time and comments, doesnt seem like it works the way i want, we have agreed upon installing the rpm while installing our product, i have got a small problem with that too, i've to start and stop dhcpd service
i tried to do that but seems like permission issue, does anyone know how to make services stop and start using php???


kal
0
 
CJ_SCommented:
What server is it?
0
 
kaldudeAuthor Commented:
its a redhat 7.1, with the dhcp server that comes along...
0
 
CJ_SCommented:
Like I said before, it has to be a security issue. I'm sorry but have no experience or knowledge on how to set that up on Linux :-( Can't help further...

CJ
0
 
nico5038Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
CJ_SCommented:
/me Agree
0
 
JgouldCommented:
Question has been closed as per recommendation

JGould-EE Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now