#37822 [Opn->Csd]: Using PDO from CLI script results in seg fault
| From: | toolbag at gmail dot com | Date: | Fri, 16 Jun 2006 18:45:14 +0000 |
| Subject: | #37822 [Opn->Csd]: Using PDO from CLI script results in seg fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98420@lists.php.net to get a copy of this message | ||
ID: 37822
User updated by: toolbag at gmail dot com
Reported By: toolbag at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Reproducible crash
Operating System: GNU/Linux kernel 2.4.21
PHP Version: 5.1.4
New Comment:
Closing due to found resolution.
Previous Comments:
------------------------------------------------------------------------
[2006-06-16 18:44:33] toolbag at gmail dot com
Resolution!
This had to do with how the oci8 library was compiled in. Previously we
were doing:
--with-oci8=shared
but removing the "shared" attribute and having just:
--with-oci8
thereby defaulting to "static" works. No more segfaults. Since the PDO
modules had to be compiled in as shared we figured the same was true
for OCI8. Not the case.
------------------------------------------------------------------------
[2006-06-16 15:47:16] toolbag at gmail dot com
After more poking around I have determined that this is only a problem
when a PDO object with driver type of Oracle is used. Trying to create
an empty PDO objects results in missing parameters (good!) but once the
"oci:dbname=<db>" argument is thrown in, the seg fault appears. We are
re-compiling with debugging enabled, so hopefully soon I can provide
more info.
------------------------------------------------------------------------
[2006-06-15 23:13:52] toolbag at gmail dot com
Description:
------------
Instantiating a PDO object from a PHP script that is called from the
CLI results in a seg fault. Running the same script from a browser is
perfectly ok. I am using PDO + PDO_OCI in a large web app with no
problems, but when I coded up some PDO/OCI code to run within a
cronjob, this happens.
Reproduce code:
---------------
<?php
try {
$dbh = new PDO("oci:dbname=<host>", "<user>",
"<pass>");
}catch(PDOException $e) {
die("Error: " . $e->getMessage() );
}
$dbh = null;
echo "I am never reached";
?>
Expected result:
----------------
From the browser I see: "I am never reached".
From the CLI: immediate seg fault.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37822&edit=1