Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16143 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86338 invoked by uid 1010); 29 Apr 2005 15:26:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86260 invoked from network); 29 Apr 2005 15:26:25 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 29 Apr 2005 15:26:25 -0000 X-Host-Fingerprint: 64.233.184.199 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.199:62175] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 1.2.12rc1 r(5476:5477)) with SMTP id 13/E3-20173-F1252724 for ; Fri, 29 Apr 2005 11:26:23 -0400 Received: by wproxy.gmail.com with SMTP id 37so821354wra for ; Fri, 29 Apr 2005 08:26:17 -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:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rRp96kj+7SNKe9d/gWvDum9FxC5F1YgYwkDIcpZbPthCcA9nUs1vAuT4d/jaKBjQGoxcolVtsvy6/taVmEc95cH2Teij8vW+Z5AV5gFTfLgA+5eD46koxW1k0fuEXKH7o77gUcPOq/5FjJjOBvPYamJwdSDp5U42JEDODLyXFus= Received: by 10.54.81.2 with SMTP id e2mr1791029wrb; Fri, 29 Apr 2005 08:26:17 -0700 (PDT) Received: by 10.54.4.22 with HTTP; Fri, 29 Apr 2005 08:26:17 -0700 (PDT) Message-ID: Date: Fri, 29 Apr 2005 10:26:17 -0500 Reply-To: Greg Donald To: Dan Scott Cc: 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: destiney@gmail.com (Greg Donald) On 4/28/05, Dan Scott wrote: > 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. Yup. Confusing that the base extension is PDO, but the drivers are lowercase like pdo_mysql for example. I see what's going on now. > 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. Yup. :) > 3. You plan on connecting to MySQL, but don't appear to have loaded > pdo_mysql.so anywhere. So you need to fix that. I didn't realize I had to build pdo_mysql.so seperately. Thanks. In the manual where it says "The following drivers currently implement the PDO interface:" made me thing I got them all when I built PDO. Now that I got all that worked out MySQL refuses my dsn string: Connection failed: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111) I can connect using this user and password using the mysql command line client with no problems. I have other PHP scripts connecting successfully with this user as well. See any problems with this code? $dsn =3D 'mysql:host=3D127.0.0.1;dbname=3Dtest'; $user =3D 'root'; $password =3D 'changeme'; try { $dbh =3D new PDO( $dsn, $user, $password ); } catch( PDOException $e ) { echo 'Connection failed: ' . $e->getMessage() . "\n"; } My MySQL user works otherwise: > mysql -uroot -p Enter password:=20 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.0.24 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> Thanks, --=20 Greg Donald Zend Certified Engineer http://destiney.com/