問題描述
我沒有注釋下一行(在我的 php.ini 中):
I have the next lines uncommented (in my php.ini):
extension=php_oracle.dll
extension=php_oci8.dll
然后我下載了這個文件 instantclient-basiclite-nt-11.2.0.2.0.zip
并解壓縮并將其放在驅動器 D...
And I downloaded this file instantclient-basiclite-nt-11.2.0.2.0.zip
and unzipped and put that on drive D...
我使用的是 Windows XP
I am using Windows XP
我這樣設置環境變量:
LD_LIBRARY_PATH C:instantclient_11_2:$LD_LIBRARY_PATH
ORACLE_HOME C:instantclient_11_2
但是當我執行 oci_connect()
函數時,我看到了這個錯誤:
But when I execute oci_connect()
function, I see this error :
致命錯誤:調用未定義的函數 oci_connect() in ...
Fatal error: Call to undefined function oci_connect() in ...
我在 erroeLog 文件中發現了這個警告:
and i found this warnings on erroeLog file:
[2011 年 12 月 29 日 00:36:39] PHP 警告:PHP 啟動:無法加載動態庫 'c:phpextphp_oci8.dll' - 找不到指定的模塊.在未知的第 0 行
[29-Dec-2011 00:36:39] PHP Warning: PHP Startup: Unable to load dynamic library 'c:phpextphp_oci8.dll' - The specified module could not be found. in Unknown on line 0
[29-Dec-2011 00:36:39] PHP 警告:PHP 啟動:無法加載動態庫 'c:phpextphp_oracle.dll' - 找不到指定的模塊.
[29-Dec-2011 00:36:39] PHP Warning: PHP Startup: Unable to load dynamic library 'c:phpextphp_oracle.dll' - The specified module could not be found.
推薦答案
檢查事項:
您不需要設置
LD_LIBRARY_PATH
或ORACLE_HOME
.但是,您需要將D:instantclient_11_2
添加到PATH
環境變量并重新啟動計算機以使更改生效.
You don't need to set
LD_LIBRARY_PATH
norORACLE_HOME
. However, you need to addD:instantclient_11_2
to thePATH
environmental variable and restart the computer so changes apply.
在配置 PHP 之前,請檢查您的 Oracle 客戶端庫是否確實有效(例如,嘗試連接 SQL Developer).
Before configuring PHP, check that your Oracle client libraries actually work (for instance, try to connect with SQL Developer).
注釋掉 extension=php_oracle.dll
.它屬于舊的且已棄用的 Oracle 擴展.
Comment out the extension=php_oracle.dll
. It belongs to the old and deprecated Oracle extension.
仔細檢查php_oci8.dll
文件是否真的位于c:phpextphp_oci8.dll
?
Double check that the php_oci8.dll
file is really at c:phpextphp_oci8.dll
?
這篇關于致命錯誤:調用未定義的函數 oci_connect()的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!