OSQA is unmaintained. Help us figure out where to go from here.

I am trying to execute two dmd commands simultaneously using PHP shell_exec(). One command runs Tshark for 5 seconds. The second command runs an .exe file. Tshark is a program which captures network packs transferring over a network interface. The second program (named mtu.exe) sends network packets from my local machine to a remote machine.

Thing is that when I run these commands manually, I run the first command. A moment after that, I run the second one, and all goes well and within a second or so, the expected packets are transferred by mtu.exe and are captured by tshark.exe. Everything works perfectly well.

But then when I run the following script to execute these commands, I get the following output:

$firstCommand = '"C:\Program Files\Wireshark\tshark.exe"  -a duration:5  -w capture.pcapng  2>&1';
echo $firstCommand."<br><br>";

$secondCommand = "mtu.exe -d0 -a43020008 -g43010008 -i987654321 -s"Merry Xmass"  2>&1";
echo $secondCommand."<br><br>";

echo shell_exec($firstCommand . " && " . $secondCommand);


"C:\Program Files\Wireshark\tshark.exe"  -a duration:5  -w capture.pcapng  2>&1

mtu.exe -d0 -a43020008 -g43010008 -i987654321 -s"Merry Xmass"  2>&1

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\Test\index.php on line 10

Line 10 is the line where shell_exec() is. The question how to fix this issue? Why is this happening?

asked 29 Apr, 02:07

Jesss's gravatar image

accept rate: 0%

edited 29 Apr, 02:08

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 29 Apr, 02:07

question was seen: 161 times

last updated: 29 Apr, 02:08

p​o​w​e​r​e​d by O​S​Q​A