我有下面的代碼在我的WordPress文件:「調用未定義功能sqlsrv_connect()」在WAMP,安裝的驅動程序
$sql_server_2008 = sqlsrv_connect(
'$ip',
array(
'Database'=>'$database_name',
'UID'=>'$uid',
'PWD'=>'$password'
)
);
,我發現了以下錯誤:
Fatal error: Call to undefined function sqlsrv_connect()
我使用PHP 5.6.25運行Wamp,所以我安裝了5.6版本的SQL Server驅動程序。在php.ini中的:
extension=php_pdo_sqlsrv_56_nts.dll
extension=php_pdo_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_nts.dll
extension=php_sqlsrv_56_ts.dll
和他們展示活躍在WAMP的UI:
那麼,爲什麼不工作?
編輯:他們沒有顯示在加載的擴展。
$extensions = get_loaded_extensions();
print_r($extensions);
返回:
Array ([0] => Core [1] => bcmath [2] => calendar [3] => ctype [4] => date [5] => ereg [6] => filter [7] => ftp [8] => hash [9] => iconv [10] => json [11] => mcrypt [12] => SPL [13] => odbc [14] => pcre [15] => Reflection [16] => session [17] => standard [18] => mysqlnd [19] => tokenizer [20] => zip [21] => zlib [22] => libxml [23] => dom [24] => PDO [25] => bz2 [26] => SimpleXML [27] => wddx [28] => xml [29] => xmlreader [30] => xmlwriter [31] => apache2handler [32] => Phar [33] => curl [34] => com_dotnet [35] => fileinfo [36] => gd [37] => gettext [38] => gmp [39] => intl [40] => imap [41] => ldap [42] => mbstring [43] => exif [44] => mysql [45] => mysqli [46] => pdo_mysql [47] => pdo_sqlite [48] => soap [49] => sockets [50] => sqlite3 [51] => xmlrpc [52] => xsl [53] => mhash [54] => Zend OPcache [55] => xdebug)
你可以從phpinfo添加你的擴展配置節(sqlsrv)嗎? –
嗨@mim,我找不到phpinfo上的任何地方 - 它應該在哪裏? – BFWebAdmin
@mim - 編輯的問題;他們似乎沒有被加載。我該如何解決這個問題? – BFWebAdmin