在这个php配置中启用了mysqli扩展吗?

时间:2011-06-08 20:55:23

标签: php mysqli

我在php中设计了一个带有mysqli(mysql - 改进)扩展的网站。 phpinfo()页面显示了这个:

  

./ configure --disable-fileinfo --disable-phar --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic -quotes --enable-mbstring --enable-pdo = shared --enable-soap --enable-sockets --enable-wddx --enable-zend-multibyte --enable-zip --prefix = / usr --with -bz2 --with-curl = / opt / curlssl / --with-curlwrappers --with-freetype-dir = / usr --with-gd --with-imap = / opt / php_with_imap_client / --with-imap- ssl = / usr --with-jpeg-dir = / usr --with-kerberos --with-libdir = lib64 --with-libexpat-dir = / usr --with-libxml-dir = / opt / xml2 - with-libxml-dir = / opt / xml2 / --with-mcrypt = / opt / libmcrypt / --with-mysql = / usr --with-mysql-sock = / var / lib / mysql / mysql.sock - with-mysqli = / usr / bin / mysql_config --with-openssl = / usr --with-openssl-dir = / usr --with-pcre-regex = / opt / pcre --with-pdo-mysql = shared - -with-pdo-sqlite = shared --with-pic --with-png-dir = / usr --with-pspell --with-sqlite = shared --with-tidy = / opt / tidy / --with- xmlrpc --with-xpm-dir = / usr --with-xsl = / opt / xslt / --with-zlib --with-zlib- DIR = / USR

这是否意味着在此配置中启用了mysqli扩展?

2 个答案:

答案 0 :(得分:21)

如果启用了mysqli扩展名,那么在同一个phpinfo页面上会出现“支持MysqlI支持”表格标题。寻找:

enter image description here


如果你想在脚本中查找,请查找一个特定于mysqli的函数,如mysqli_connect(),然后检查它是否存在:

var_dump(function_exists('mysqli_connect'));

如果输出FALSE,则它不存在,很可能你不能使用该模块。

答案 1 :(得分:4)

这意味着它是使用mysqli支持编译的。模块是否启用是另一个问题。