Solved

Forking not speeding anything up?????

Posted on 2003-11-06
2
218 Views
Last Modified: 2008-03-06
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
Comment
Question by:lazyelm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Expert Comment

by:aolXFT
ID: 9695649
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
 
LVL 8

Accepted Solution

by:
inq123 earned 500 total points
ID: 9698315
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to use 2 ON statements in inner join 3 44
PHP-MSSQL 2016 connection requirements for Windows 2012 29 80
How do I allow for non standard CSV file 9 47
history of pages 7 53
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question