I have a code something like this:
$file = fopen( "debug.txt", "w" ); $command = "myExe.exe param0 param1"; fprintf( $file, "starting\r\n" ); fflush( $file ); system( $command ); fprintf( $file, "the end...\r\n" ); fflush( $file );
He prints "beginning", but not "end ...". The system () function is hanging.
MyExe.exe is an application written in C ++ that actually terminates; those. The main function of myExe ends with the following code:
FILE* f = fopen( "test.txt", "w" ); fclose(f); return 0;
Is being created
test.txt, which means that "myExe.exe" works and ends normally.
This problem does not occur every time the php file is called; sometimes hanging, sometimes working ...
Any help & idea would be appreciated. Thanks in advance.
about; OS: win xp php server: wamp server 2.0
edit: my problem is not in my debug files. These are system () or exec () functions. I can delete all other lines.
my php script works well for about 4/5 attempts. After calling system (), I call some sql functions, but when system () freezes, my page will give a fatal error.
source share