I swear, it was just working last week! Well, a while ago, on another
machine. You get the idea. Here's the deal...
PHP 5.1.6 and MySQL 5.x on FC6 fully patched.
1. A simple page with a call to phpinfo() works fine.
2. A barely more complicated page also works fine, in that it throws an
expected error:
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
dsjdlfjsldfjs;
phpinfo();
?>
returns
Notice: Use of undefined constant dsjdlfjsldfjs - assumed
'dsjdlfjsldfjs' in index.php on line 22.
(thanks to another message that suggested adding the calls directly into
the page when error reporting in php.ini seems to be ignored).
Then the phpinfo data displays.
3. BUT, a call to a MySQL database:
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
@ $db=new mysqli('localhost','whil','secret','test');
if (mysqli_connect_errno())
{echo 'Error could not connect to database.';
exit;
}
?>
results in a blank page. No errors, no warnings, no nothing. I have
confirmed through the Query Browser that the credentials passed are good
and result in access to the test database on localhost.
So two things seem broken:
a) The connect doesn't work. I have done this oodles of times before,
although not on this particular machine. I'm thinking there's a config
issue with mysqli but I dunno what. The config from phpinfo is below.
b) Why does the error reporting NOT work as soon as I jam a $db new
mysql call into the code?
Thanks,
Whil
phpinfo() reports this configure script:
'./configure' '--build=i686-redhat-linux-gnu'
'--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu'
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--with-libdir=lib' '--with-config-file-path=/etc'
'--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic'
'--disable-rpath' '--without-pear' '--with-bz2' '--with-curl'
'--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
'--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm'
'--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr'
'--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr'
'--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU'
'--enable-exif' '--enable-ftp' '--enable-magic-quotes'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid'
'--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack'
'--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop'
'--enable-calendar' '--enable-dbx' '--enable-dio'
'--with-mime-magic=/usr/share/file/magic' '--without-sqlite'
'--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs'
'--without-mysql' '--without-gd' '--without-odbc' '--disable-dom'
'--disable-dba' '--without-unixODBC' '--disable-pdo'
'--disable-xmlreader' '--disable-xmlwriter'
// end
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php