Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16129 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72349 invoked by uid 1010); 28 Apr 2005 23:20:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 72323 invoked from network); 28 Apr 2005 23:20:52 -0000 Received: from unknown (HELO gmail.com) (127.0.0.1) by localhost with SMTP; 28 Apr 2005 23:20:52 -0000 X-Host-Fingerprint: 64.233.170.196 rproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.170.196:14383] helo=rproxy.gmail.com) by pb1.pair.com (ecelerity 1.2.12rc1 r(5476:5477)) with SMTP id 1C/AC-20173-3DF61724 for ; Thu, 28 Apr 2005 19:20:51 -0400 Received: by rproxy.gmail.com with SMTP id i8so429442rne for ; Thu, 28 Apr 2005 16:20:48 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RWFYiaBxq/k90W2v617qhzNAfmbY2e9lLbnGK1i3jx4HoGmBez2MsQchPf18RVWJvRG4JYPsFgoKBmkqlcqd707xpNTNgTOuTL2W0a9YpZeyOhIvtFzHN2Y/4uPUxDuFX29hi+zQlH5QVARrMYBbtWHFSmMyKZT9gd4pQmi2PeQ= Received: by 10.38.88.70 with SMTP id l70mr3005386rnb; Thu, 28 Apr 2005 16:20:47 -0700 (PDT) Received: by 10.38.65.30 with HTTP; Thu, 28 Apr 2005 16:20:47 -0700 (PDT) Message-ID: Date: Thu, 28 Apr 2005 19:20:47 -0400 Reply-To: Dan Scott To: Greg Donald , php-dev In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Subject: Re: [PHP-DEV] help with backtrace/debuging From: denials@gmail.com (Dan Scott) On 4/28/05, Greg Donald wrote: > On 4/28/05, Dan Scott wrote: > > Does the segfault only occur when you load PDO into mod_php? > > > > If you haven't already tried it, try using PHP CLI to reproduce the > > problem instead; that removes one major variable (Apache) from the > > equation. Ensure that PHP is built with --enable-debug, then rebuild > > PDO and try to reproduce the segfault from the command line. >=20 > I rebuilt PDO and enabled debugging. It's acting a bit different now > with debugging and being outside of Apache: >=20 > > cat pdo.php > #!/usr/bin/php -q > =20 > error_reporting( E_ALL ); >=20 > $extensions =3D get_loaded_extensions(); >=20 > if( in_array( 'pdo', $extensions ) ) > { > echo 'pdo.so extension already loaded'; > } > else > { > if( dl('pdo.so') ) > { > echo 'pdo.so extension loaded with dl()'; > } > else > { > echo 'pdo.so extension failed to load with dl()'; > } > } >=20 > $dsn =3D 'mysql:dbname=3Dtest;host=3Dlocalhost'; > $user =3D 'root'; > $password =3D 'passwd'; >=20 > try { > $dbh =3D new PDO($dsn, $user, $password); > } catch (PDOException $e) { > echo 'Connection failed: ' . $e->getMessage(); > } >=20 > ?> >=20 > > ./pdo.php >=20 > Warning: Module 'PDO' already loaded in Unknown on line 0 > pdo.so extension failed to load with dl()Connection failed: could not > find driver/var/tmp/portage/php-5.0.3-r1/work/php-5.0.3/Zend/zend_execute= .c(3255) > : Freeing 0x08613A4C (16 bytes), script=3D./pdo.php > =3D=3D=3D Total 1 memory leaks detected =3D=3D=3D >=20 > > head /etc/php/cli-php5/php.ini > [PHP] >=20 > extension=3Dpdo.so >=20 > ;;;;;;;;;;; > ; WARNING ; > ;;;;;;;;;;; > ; This is the default settings file for new PHP installations. > ; By default, PHP installs itself with a configuration suitable for > ; development purposes, and *NOT* for production purposes. >=20 > -- > Greg Donald > Zend Certified Engineer > http://destiney.com/ >=20 Oops, didn't mean to take this off-list... So three things: 1. If you print the results of get_loaded_extensions(), you'll see that pdo turns up as 'PDO', but you're looking for 'pdo' -- so the result of your first if() is FALSE. 2. You then try loading pdo.so again, but it's already loaded by php.ini, therefore you get the Warning and your own error message. 3. You plan on connecting to MySQL, but don't appear to have loaded pdo_mysql.so anywhere. So you need to fix that. Dan