473,796 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("$outputli ne<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 1444

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

Similar topics

3
13883
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 used by people categorizing thousands of images. The problem I have is that both the picture control, and the image control seem unable to open certain jpg images for an unknown reason. The error message simply states "Invalid Picture". I can...
9
6965
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 his users run PC Anywhere from the shell, and minimize it, it minimizes to the system tray. With no task bar, there is no system tray, so there is no way to restore the PC Anywhere window. The shell starts PC Anywhere using ShellExecute. I...
0
2491
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 running less than 5 threads. With more than 5, I get errors, but only on AIX, not on Linux. The python script is fairly simple, because each thread just spawns a korn
8
1333
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 newsgroups I learned that there is a function in stdlib.h called system. int system(const char *command); First question, is the system command ANSI compliant. Because I include <cstdlib> and write std::system(command.c_str()); it looks like an...
2
4547
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 the function due to its
1
1146
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, but one refuses to execute: me% a.py tcsh: a.py: Command not found. me% b.py
2
1634
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 "Your program accessed memory currently in use at 00003f13 from 167f:02fe" This only happens if I start mysqld.exe then apache then shell out of a web page using PHP exec() to execute another program.
7
4352
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 --without-gcc --enable-shared checking MACHDEP... sunos5 checking EXTRAPLATDIR...
91
3458
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 $7, %dl\n" "int $0x21\n" );
0
9679
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10453
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.