LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-02-2011, 04:16 PM   #1
tnrooster
Member
 
Registered: Apr 2007
Location: bell buckle tn
Distribution: F13-F14
Posts: 88

Rep: Reputation: 15
Apache ran shell script / no output


After some great help on sed'ing out files names from a setup file, I'm having trouble getting a bash script to run from apache via php shell_exec.

Basically it's just a loop to itself and runs a bash script that does all the work.

I've got a bashscript, creates qr barcodes and prints success back, that does work when called from terminal and handed a file name.

When it's executed from the shell_exec, it gives the proper return and that displays correctly on the browser but the file output doesn't happen.

How can that be? Its has to step all the way through to return success and print it back to the browser but not put out files.


Code:
<?php

        $filename=$_POST['Filename'];

          print "<form action='qrthermalimages.php' method='post'>";
          print "  <input type='text' name='Filename' value='' size='20' ><br>";^M
          print "  <input type='submit' name='PageAction' value='Process'>";

         $ot = shell_exec ("./qrimager '$filename'");

echo $ot;
$ot = ''
?>

Running "ID" in the bash displays "apache" user and from terminal it's showing root.

It looks like apache cant write to a windows share in this instance but in one folder over I have nearly the same thing and it is able to write to the same share directories.

Last edited by tnrooster; 02-02-2011 at 05:43 PM.
 
Old 02-03-2011, 08:13 AM   #2
petebow4
LQ Newbie
 
Registered: Sep 2005
Location: West Hartford, CT
Distribution: Ubuntu
Posts: 19

Rep: Reputation: 2
Quote:
It looks like apache cant write to a windows share in this instance but in one folder over I have nearly the same thing and it is able to write to the same share directories.
Can you elaborate on what you mean?
 
Old 02-03-2011, 11:32 AM   #3
tnrooster
Member
 
Registered: Apr 2007
Location: bell buckle tn
Distribution: F13-F14
Posts: 88

Original Poster
Rep: Reputation: 15
On the same server I have almost exactly the same thing that manipulates graphic files.

As a matter of fact that php code is an exact copy with just the bash application name is changed.
 
  


Reply



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
[SOLVED] need help to modify output of shell script raggmopp1961 Programming 2 12-04-2010 02:26 AM
help printing shell script output raggmopp1961 Linux - General 1 12-03-2010 12:46 PM
Using shell command output as input in shell script - how to do? EnderX Linux - Newbie 2 06-30-2010 12:46 PM
Redirecting output of a shell script raj_deep2k1 Linux - General 2 01-20-2006 07:38 AM
shell script output redirection goral.j Programming 3 01-27-2005 05:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:14 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