Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2002-04-08
10
457 Views
Last Modified: 2013-11-13
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
Comment
Question by:kaldude
10 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 6925318
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
 
LVL 22

Expert Comment

by:CJ_S
ID: 6925319
echo not eche :-)
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6925321
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:kaldude
ID: 6931656
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
 
LVL 22

Expert Comment

by:CJ_S
ID: 6931964
What server is it?
0
 

Author Comment

by:kaldude
ID: 6932342
its a redhat 7.1, with the dhcp server that comes along...
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6936200
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
 
LVL 54

Expert Comment

by:nico5038
ID: 7508172

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
 
LVL 22

Expert Comment

by:CJ_S
ID: 7508361
/me Agree
0
 

Accepted Solution

by:
Jgould earned 0 total points
ID: 7548089
Question has been closed as per recommendation

JGould-EE Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question