in reply to Re: http waits on process
in thread http waits on process

As I said, the problem happened only when I did it from cgi script through the web page, when I tried it from a regular script, I had no problem.
Additionally, I already tried the solution you suggested (fork and exec), and still I get the same problem, I think it something related to apache that waits for stdout or someting (closing stdout, didn't work also).
Do you have another idea?