homepage Welcome to WebmasterWorld Guest from 54.198.142.4
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
How to find process id from external command and use it for "Loading"
ktsirig




msg:4266408
 1:27 pm on Feb 13, 2011 (gmt 0)

Hello!
I am executing an external command from a PHP script, using the exec function. Since this program can take more than 1-2 minutes to run, I thought I should use a "Loading page...please wait". What I need is to be able to get the process id from the external program that is being run and, when this finishes, I'll start outputting the results.

Is there a way to do this?

 

coopster




msg:4266779
 1:37 pm on Feb 14, 2011 (gmt 0)

Why do you need the process id? Will the second argument to exec() not work? If not, you may also want to review some of your other System program execution [php.net] options.

rocknbil




msg:4266906
 5:13 pm on Feb 14, 2011 (gmt 0)

Your browser may time out in that amount of time, rendering the idea not so reliable . . . current discussion on fork() [webmasterworld.com] to allow it to run as a "background process." Fork will return the PID of the child process.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved