|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24302 pcntl_fork causes DB insert/update to fail.
Submitted: 2003-06-23 16:01 UTC Modified: 2003-06-30 08:23 UTC
From: karl at karlaustin dot com Assigned:
Status: Not a bug Package: PEAR related
PHP Version: 4.3.1 OS: RH7.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: karl at karlaustin dot com
New email:
PHP Version: OS:


 [2003-06-23 16:01 UTC] karl at karlaustin dot com
When using pcntl_fork with PHP the child processes are unable to use a database connection that has been created via PEAR DB to a postgresql DB server to update/insert any rows.

Reproduce code:

Expected result:
DB Should have updated values. It does not.

Actual result:

server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-24 07:37 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This doesn't work, cause the parent kills the connection automatically via zend_list_delete when it ends.
 [2003-06-24 11:01 UTC] karl at karlaustin dot com
I have tried creating a new connection (in the child) once the process has been forked, it will also not do an INSERT or UPDATE either, as the connection is created in the child, I would assume the parent should not close the connection? Yet it appears it does.
 [2003-06-30 08:23 UTC]
This doesn't seem to be a PEAR DB problem. Please test your code with the native functions and reopen this bug if you still feel that it's a PEAR DB related issue.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 04:01:29 2024 UTC