LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 04-03-2005, 01:04 PM   #1
farmerjoe
Member
 
Registered: Oct 2004
Location: Texas
Distribution: Ubuntu - Home, RHEL4 - Server
Posts: 96

Rep: Reputation: 15
How do I make PHP display output from my shell script?


Ok, i have a small problem. I am calling a shell script with PHP using the shell_exec() function. I can't, however, get it to echo the output of the script onto the webpage. Here is the code:

$ouput = shell_exec($command);
echo "$output";

Any ideas? Is there some special thing i need to do in my shell script?

Thanks,
Lyle Pratt
 
Old 04-03-2005, 01:12 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Re: How do I make PHP display output from my shell script?

Quote:
Originally posted by farmerjoe
$ouput = shell_exec($command);
echo "$output";
$ouput is not the same as $output.

Try changing the variables to being the same thing.
 
Old 04-03-2005, 01:15 PM   #3
farmerjoe
Member
 
Registered: Oct 2004
Location: Texas
Distribution: Ubuntu - Home, RHEL4 - Server
Posts: 96

Original Poster
Rep: Reputation: 15
Hah, i cant believe my own stupidity (well..maybe i can) but hey! Thanks so much!

-farmerjoe
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
display ifconfig output in php ?? ALInux Programming 1 10-29-2005 04:23 PM
series-Write a single shell command to display the following output ricki Programming 2 07-31-2005 03:53 PM
How do I display real shell script output to web page. farmerjoe Programming 1 04-07-2005 01:03 PM
shell script output redirection goral.j Programming 3 01-27-2005 05:34 AM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM


All times are GMT -5. The time now is 12:52 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration