php.net |  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
 [2003-06-23 16:01 UTC] karl at karlaustin dot com
Description:
------------
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:
---------------
http://www.karlaustin.com/php/pcntl-db.phps

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

Actual result:
--------------
Error:

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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

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] cox@php.net
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: Fri Mar 29 12:01:27 2024 UTC