Jump to content

Recommended Posts

I have a script which opens a connection with pg_connect(), and then forks off several children. When the children are finished, they exit.

Unfortunately, these children inherit the parent's postgres connection, and they close this connection when they exit.

Is there any way to stop the children from closing the connection?
Link to comment
https://forums.phpfreaks.com/topic/5391-children-close-parents-pg-connection/
Share on other sites

  • 5 months later...
Thanks for the suggestion!  I solved this by using pcntl_exec(), thus avoiding php's shutdown code.

pg_pconnect() doesn't work unfortunately, as the children believe they are the only running php process.  So they shut down all persistent connections on exit.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.