<p>I have a php script that is executing an executable that writes to a serial port.
However, everytime it runs <pre>system("c:\Untitled1.exe")</pre>
it just opens up a cmd window and freezes.</p>

<p>Anybody know how to fix this? Or if there is an easier way to get PHP to write to the serial port directly? (I've already tried these two: <a href="http://blogs.vinuthomas.com/2007/04/09/php-and-serial-ports/" rel="nofollow noreferrer">http://blogs.vinuthomas.com/2007/04/09/php-and-serial-ports/</a> and they don't work for me)</p>

<p>P.S. I am on Windows XP</p>

AFAIK
```
system()
```
call blocks the execution until the program finishes. Maybe using
```
popen()
```
,
```
fread()
```
and
```
pclose()
```
could solve this.
See
http://php.net/manual/en/function.popen.php
for more info.