Re: PHP5 and PEAR DB class
| From: | Paul DuBois | Date: | Sun, 28 Nov 2004 23:36:33 +0000 |
| Subject: | Re: PHP5 and PEAR DB class | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15881@lists.php.net to get a copy of this message | ||
Victor Menendez wrote:
Does anyone know for sure that PEAR DB class does currently work with PHP5 and Mysql 4.1? I received the following error; Error: "Non-static method DB::connect() should not be called statically" (error #2048). I know that this is a commong problem, is it just a matter for declaring a public class and calling hte DB method differently?Works for me, with either the mysql or mysqli drivers. PEAR 1.3.3.1 DB 1.6.8 PHP 5.0.2 There is a bug in the PHP mysqli extension that causes it to fail if there's no socket file in the connect string. This patch fixes it: --- mysqli_nonapi.c.orig 2004-09-04 09:19:20 -05:00 +++ mysqli_nonapi.c 2004-10-18 15:12:45 -05:00 @@ -49,6 +49,10 @@ return; } + if (!socket_len) { + socket = NULL; + } + /* TODO: safe mode handling */ if (PG(sql_safe_mode)){ } else { The patch is in the current CVS, but I don't think it's in any released version. 5.0.3, perhaps.