From:             tg at idiom dot dk
Operating system: Linux 2.6.12.5
PHP version:      5.1.6
PHP Bug Type:     PDO related
Bug description:  PDO fails for no apparent reason, pages that works randomly 
breaks

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 bug report at http://bugs.php.net/?id=38886&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38886&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38886&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38886&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38886&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38886&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38886&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38886&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38886&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38886&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38886&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38886&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38886&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38886&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38886&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38886&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38886&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38886&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38886&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38886&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38886&r=mysqlcfg

Reply via email to