LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-01-2008, 12:47 AM   #1
megerdin
Member
 
Registered: Jul 2007
Location: London
Distribution: FC11,FC10,FC7,FC4,Centos 5.1,Ubuntu,Mandrake Linux,puppy.LinuxMint.Opensuse
Posts: 181

Rep: Reputation: 31
shell scripts output in PHP


I want to show output of a shell scripts in PHP page.
how to do it please help?

note: Running PHP on fc7
 
Old 09-01-2008, 01:03 AM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
Try something like this:-

Code:
<?php
echo '<pre>';
// Use 'system' to run the script.
$scriptOutput = system('/your/script/name', $retval);
echo '</pre>';
?>
 
Old 09-01-2008, 01:34 AM   #3
megerdin
Member
 
Registered: Jul 2007
Location: London
Distribution: FC11,FC10,FC7,FC4,Centos 5.1,Ubuntu,Mandrake Linux,puppy.LinuxMint.Opensuse
Posts: 181

Original Poster
Rep: Reputation: 31
Thanks working...........
 
  


Reply

Tags
output, php, scripts, shell



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
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 06:24 AM
PHP and shell scripts PCSpectra Linux - Security 2 11-30-2007 06:38 PM
Calling shell scripts from PHP as other users Thin Programming 1 12-02-2005 08:17 AM
PHP and Shell scripts haze Programming 4 04-15-2005 02:52 AM
How do I make PHP display output from my shell script? farmerjoe Programming 2 04-03-2005 01:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:48 AM.

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