1.环境信息及准备工作:
win7 x64,php5.6-ts-x86,oracle instantclient_11_2 x86,apache2.4
如php中缺少php_oci_11g.dll等文件,自行网上找,我下载的是php_oci8-2.0.12-5.6-ts-vc11-x86.zip
2.apache配置php信息http_conf约184行
LoadModule php5_module f:\jn\php\php5.6\php5apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "f:/jn/php/php5.6"
3.php.ini配置信息
extension=php_oci8_11g.dll
extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
error_log = f:/jn/php/php_errors.log
extension_dir = "f:/jn/php/php5.6/ext"
4.环境变量配置信息
LD_LIBRARY_PATH=C:\instantclient_11_2
ORACLE_HOME=C:\instantclient_11_2
NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
PATH追加F:\jn\php\php5.6;F:\jn\php\php5.6\ext;C:\instantclient_11_2;
5.拷贝php5.6/ext下的php_oci_11g.dll到c:/windows/s y s t e m32下
未拷贝时报错PHP Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your s y s t e m - please check that PATH i n c l u d es the directory with Oracle Instant Client libraries in F:\jn\www\info1.php on line 5
测试例子: