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

aru*_*air 3 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扩展?

mar*_*rio 23

如果mysqli要启用扩展,那么在同一phpinfo页面上应该出现" 启用MysqlI支持 "的表头.寻找:

在此输入图像描述


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

var_dump(function_exists('mysqli_connect'));
Run Code Online (Sandbox Code Playgroud)

如果输出为FALSE,则它不存在,很可能您无法使用该模块.


Joh*_*ght 5

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

  • 如果已经有phpinfo()结果,则搜索单词“ mysqli”。您应该看到一节概述了mysqli模块的所有详细信息。 (2认同)