LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-25-2013, 12:01 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
php - exec: it's not forking


Hi!

I'm creating a simple library to handle asynchronous tasks. I have created a shell wrapper around the task handler (another shell script) that wimply calls the real handler with a & at the end so that the handler can start and the wrapper can exit (I can follow the progress with some temp files use by the task handler). That's exactly what happens when I call the wrapper directly from CLI. It starts and exists right away wile the task starts and moves forward. Now, when I call the wrapper with exec on php it doesn't go on (so that the php script can move on while the async task does its job) but gets stuck instead till the task is finished.

Why is that? And what is the workaround? Thanks in advance.
 
Old 06-25-2013, 02:26 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
The problems seems to be related to the fact that the outputs of the process were connected to the php process. after adding &> /dev/null to the call to the task handler, it worked like a charm.
 
1 members found this post helpful.
  


Reply

Tags
asynchronous task, exec, fork, php



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forking with PHP and cURL barterdom Programming 1 04-11-2010 10:06 AM
php causes kernel to stop forking bfreeburg Linux - General 1 12-21-2006 10:49 AM
PHP / VideoLAN / Fedora Core Question - how can I get the PHP "exec" function to work gtrawoger Linux - Software 3 12-21-2005 06:51 AM
php exec devit Programming 4 04-08-2004 03:26 AM
PHP exec Spooky Programming 1 01-19-2004 08:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration