solved: system()-crash with phpGtk-win32
| From: | Sebastian G. | Date: | Mon, 04 Mar 2002 13:55:23 +0000 |
| Subject: | solved: system()-crash with phpGtk-win32 | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-1414@lists.php.net to get a copy of this message | ||
Sebastian G. wrote:
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > for several days now I'm fighting with the opportunity
> > > > > > > > to start an binary exe-file on a Windows 32 system inside my phpGtk-script.
> > > > > > > > The script is an Scanning-application which is used to scan
> > > > > > > > and archieve images. To communicate between php and the TWAIN-compatible driver of my scanner (Agfa
> > > > > > > > SnapScan e50) I use that binary exe-file
> > > > > > > > named TwainCom.exe by Jungclaus Software (www.jse.de). This
> > > > > > > > binary is a commandline-tool, which is able to use my Scanner-drivers functionality to scan images
> > > > > > > > and save them in a given format such as
> > > > > > > > JPEG or TIFF.
> > > > > > > > To make it short: In my phpGtk-application the system()-call
> > > > > > > > crashes my script. When I then kill my script (Not the TwainCom.exe-binary, which is still running),
> > > > > > > > TwainCom.exe continues to run and
> > > > > > > > finishes the job successful. If I'd instead kill the
> > > > > > > > TwainCom.exe-binary, my phpGtk-script will continue to run. If I then run the system()-call a second
> > > > > > > > time, everything works fine. The third try
> > > > > > > > will crash my script again, I kill the TwainCom.exe-binary,
> > > > > > > > my script continues, I try the fourth time, it works, on the fifth try it crashes again and so on
> > > > > > > > and so on :(
> > > > > > > > But: When I run the same system()-call just on command-line
> > > > > > > > or inside a "normal" (small) php-script or phpGtk-script, it does _never_ crash, as it
> > > > > > > > happens in the big phpGtk-script of mine.
> > > > > > > > As I found out, there is a program named
> > > > > > > > "Twunk_16", which is always getting loaded at the same time running the
> > > > > > > > TwainCom.exe-binary. If this program is running (I am not able to start it manually,
> > > > > > > > don't know why...), the system()-call inside my big
> > > > > > > > phpGtk-script will work. But having "Twunk_16" running requires to start the
> > > > > > > > TwainCom.exe-binary, wait till it crashes, then kill it. Killing it
> > > > > > > > makes "Twunk_16" stay in memory until I run my
> > > > > > > > system()-call.
> > > > > > > > I also tried all this with the exec(), pasthru() and
> > > > > > > > popen()/fwrite()-calls. They all have the same unstable behavior.
> > > > > > > >
> > > > > > > > I hope, you've got the point. I really need help on
> > > > > > > > this, cause this project of mine is running out of time and it's gonna cost _alot_ ;( Please
> > > > > > > > ask me _everything_, cause I'll be there... of course I
> > > > > > > > may mail you a copy of my code, too.
> > > > > > > >
Hi,
I think I've got the solving:
The error did not occur after I've been renaming twunk_16.exe and twunk_32.exe so that Windows
would
not be able to load them. So now these files won't get loaded when I'm running the
TwainCom.exe-binary at it looks like it works.
Thanks for this one goes to Steph and JSE.de
--
MfG, Sebastian G. : mailseppel@gmx.de : HH-germany :