|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19952 PEAR DB plus "+" sign in password field
Submitted: 2002-10-17 09:18 UTC Modified: 2002-10-28 23:08 UTC
From: miki_fossati at libero dot it Assigned:
Status: Not a bug Package: PEAR related
PHP Version: 4.2.3 OS: linux SUSE 7.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: miki_fossati at libero dot it
New email:
PHP Version: OS:


 [2002-10-17 09:18 UTC] miki_fossati at libero dot it
Here's a little test:

$failDsn = "mysql://foo:bar+@localhost/foo";
$succDsn = array(
                   "phptype"  => "mysql",
                   "hostspec" => "localhost",
                   "database" => "foo",
                   "username" => "foo",
                   "password" => "bar+"
$failDb = DB::connect($failDsn, true);
$succDb = DB::connect($succDsn, true);
if (DB::isError($failDb)) {
    echo "failDsn incorrect?\n";
if (DB::isError($succDb)) {
    echo "Hey! are you kidding?\n";

It seems that the plus "+" sign in the password field causes a bad parsing on the DSN string.

./configure --with-apxs=../apache/bin/apxs --with-mcrypt --with-mhash --with-xml --with-mysql=../mysql/ --enable-cli --enable-pcntl


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-28 23:08 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

If your password contains non-alphanumeric characters do a urlencode() on the value before passing it if you are using the "mysql://foo:bar+@localhost/foo" format to pass data to DB::connect();
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 01:01:33 2024 UTC