473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

problem running shell executables

LRW
I'm using a PHP script to run some command line...commands, and they
seem to half work.
Here's what I have:

<?php
$mog = escapeshellcmd("/usr/bin/mogrify -size 180x180 -colorspace RGB
+profile \"*\" /usr/shipthumbs/*.tif");
$mont = escapeshellcmd("/usr/bin/montage -tile 4x4 -colorspace RGB
-label \"%f\" -resize 180x180 -geometry 180x180+0+0 -gravity South
/usr/shipthumbs/*.* /usr/shipthumbs/montage.png");
$del_t = escapeshellcmd("/bin/rm -f /usr/shipthumbs/*.tif");
$del_e = escapeshellcmd("/bin/rm -f /usr/shipthumbs/*.eps");

exec("$mog 2>&1", $output);
echo $output;
exec("$mont 2>&1", $output);
echo $output;
exec("$del_t 2>&1", $output);
echo $output;
exec("$del_e 2>&1", $output);
echo $output;
echo "Completed.";
foreach($output as $outputline){
echo("$outputline<br>");
}

?>

I know the first command, $mog, is working fine. And the 2nd one $mont
tries because it runs for a LONG time before I finally get the
response back that it's complete.
Yet, the file montage creates doesn't get created and the files don't
get deleted, and there's no echo of an error.

I know the montage line works because it works fine when I run it in a
bash shell. And the remove lines are simple. And I know the error
reporting works, because when I didn't have appropriate permissions on
the directory the echoes were coming back with permission errors on
the montage and the removes.
So, I know it's trying, but after the mogrify it thinks it's done the
job but hasn't.

Am I missing something here? Is there another part of exec I don't
know about and am missing in the man?

Thanks for any suggestions!!
Liam
Jul 17 '05 #1
0 1421

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Trevor Fairchild | last post by:
I am making a program that categorizes pictures. The picture paths are stored in an Access Database, vb6 connects using adodc controls. This program works specifically with .jpg files. It will be...
9
by: none | last post by:
Hello all, I wrote a shell program a few years ago in VB6 that needs to be modified. The problem I have is this: The SysAdmin uses this shell in place of Explorer, so there is no taskbar. When...
0
by: Gardner Pomper | last post by:
Hi, I am pretty new to python, so be gentle :) I have a python script that spawns a number of threads (configurable) on a 12 processor AIX RISC-6000 machine. It works fine, so long as I am...
8
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
2
by: Xah Lee | last post by:
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the...
1
by: mailpitches | last post by:
Using OSX 10.4.5 This is more of a unix/tcsh question than a python question. Somehow I got to the point where I have two files 'a.py' and 'b.py' which have identical contents and permissions,...
2
by: tool | last post by:
I'm having a problem that I'm not sure of the source for... so I'm asking here as the Apache group doesnt seem to know anything about the error message Apache generates. The error message is...
7
by: plumb and tree | last post by:
I've been trying for days to build 64 bit python with Solaris 10 + Sun Studio 12. Can anyone helpl please. This is how I tried to do build: # ./configure --prefix=/opt/python2.4...
91
by: Eddie | last post by:
Hi I am using lcc-win on Windows 98. I'm writing a simple c console app, and I need to set the background color to blue. Here's the code I've got at the moment: _asm ( "movb $2, %ah\n" "movb...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.