Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • Last Modified:

Forking not speeding anything up?????

i am forking a call to another php script becuase it must connect to a mail server.  It can take up to a minute to send depending on attachments and network traffic and other factors.

here is the code i am using to call the scrip that does the email functions

exec("start c:\php\php d:\web_projects\ltrak\wwwroot\forked.php > NUL &");

When i call the script this way, it still waits for  the exec to return so it does not speed anything up.  I thought forking was meant to start a new process so that the current one can continue on with what it is doing.

Any ideas?

platform is win2k pro php 4.3.3 iis5
0
lazyelm
Asked:
lazyelm
1 Solution
 
aolXFTCommented:
try calling a program that returns before it is actually finished sending the mail.

The program would spawn another process, return and let the child process do the work.

It would probably have to be written in C/C++

Alternatively you could cache the necessary mails to be sent, and use the Windows Equivlent of a Cron job EG wincron.
0
 
inq123Commented:
Hi lazyelm,

My guess is that you would also need to redirect STDERR, e.g.:

exec("start c:\php\php d:\web_projects\ltrak\wwwroot\forked.php > NUL 2>NUL &");

Cheers!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now