ID:               38886
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tg at idiom dot dk
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: Linux 2.6.12.5
 PHP Version:      5.1.6
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2006-09-19 20:54:49] tg at idiom dot dk

Description:
------------
I run an Apache (2.0.58) server, PDO (1.0RC2) and APC (3.0.11).
My PDO randomly gives me this error (Fatal error: Call to a member
function execute() on a non-object in
/var/www/*/htdocs/classes/pdoMysql.class.php on line 33
), without any errors in the log.
The error occurs more frequently when the server is loading, but it
also happens with no particular load, and some seconds after it works
flawless again.
I've tried the latest CVS snapshop for PHP 5, but it didn't fix the
problem.

PHP configure flags:
'./configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu'
'--mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info'
'--sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli'
'--with-apxs2=/usr/sbin/apxs2'
'--with-config-file-path=/etc/php/apache2-php5'
'--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active'
'--without-pear' '--disable-bcmath' '--without-bz2'
'--disable-calendar' '--disable-ctype' '--without-curl'
'--without-curlwrappers' '--disable-dbase' '--disable-exif'
'--without-fbsql' '--without-fdftk' '--disable-filepro' '--disable-ftp'
'--with-gettext' '--without-gmp' '--disable-hash' '--without-hwapi'
'--without-iconv' '--without-informix' '--disable-ipv6'
'--without-kerberos' '--disable-mbstring' '--with-mcrypt'
'--disable-memory-limit' '--without-mhash' '--without-ming'
'--without-msql' '--without-mssql' '--with-ncurses' '--with-openssl'
'--with-openssl-dir=/usr' '--disable-pcntl' '--without-pgsql'
'--disable-posix' '--with-pspell' '--without-recode'
'--disable-simplexml' '--disable-shmop' '--without-snmp'
'--disable-soap' '--disable-sockets' '--without-sybase'
'--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem'
'--disable-sysvshm' '--without-tidy' '--disable-tokenizer'
'--disable-wddx' '--disable-xmlreader' '--disable-xmlwriter'
'--without-xmlrpc' '--without-xsl' '--with-zlib' '--disable-debug'
'--enable-dba' '--without-cdb' '--without-db4' '--without-flatfile'
'--with-gdbm' '--without-inifile' '--without-qdbm'
'--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv'
'--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr'
'--without-xpm-dir' '--with-gd' '--with-imap' '--with-imap-ssl'
'--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr/lib/mysql'
'--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--without-mysqli'
'--without-pdo-dblib' '--with-pdo-mysql=/usr' '--without-pdo-odbc'
'--without-pdo-pgsql' '--without-pdo-sqlite' '--with-readline'
'--without-libedit' '--without-mm' '--without-sqlite'

Reproduce code:
---------------
#Snip:
$this->cfg = array(
'db'      => 'mysql',
'db_user' => '*',
'db_pwd'  => '*',
'db_host' => 'localhost',
'db_db'   => '*',
'db_opts' => array(
PDO::ERRMODE_SILENT => true,
PDO::ATTR_PERSISTENT => true,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true
)
);
$this->pdo = new
PDO($this->cfg['db'].':host='.$this->cfg['db_host'].';dbname='.$this->cfg['db_db'],$this->cfg['db_user'],$this->cfg['db_pwd'],$this->cfg['db_opts']);

$stmt = $this->pdo->prepare("SELECT * FROM users");
$stmt->execute();

Expected result:
----------------
An array of info

Actual result:
--------------
Fatal error: Call to a member function execute() on a non-object in
/var/www/*/htdocs/classes/pdoMysql.class.php on line 33



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38886&edit=1

Reply via email to