简体   繁体   English

在Windows服务器上安装OCI8 php扩展

[英]OCI8 php extension installation on windows server

I have specific problem with making OCI8 work on my server installation. 我在服务器安装上使OCI8工作时遇到了特殊问题。

First setup: 首先安装:

  • Win 2008 Server 32bit 赢得2008 Server 32bit
  • ZendServer for PHP with Apache2.2 使用Apache2.2的ZendServer for PHP
  • PHP version 5.3.14 which was without php_oci8 files PHP版本5.3.14没有php_oci8文件
  • No oracle things installed 没有安装oracle东西

I need to be able to connect to remote oracle database, so I find out, that OCI8 extension should be used. 我需要能够连接到远程oracle数据库,所以我发现,应该使用OCI8扩展。 To make OCI8 work, I also should need at least Oracle Instant Client on server, because of certain DLL OCI8 need. 为了使OCI8工作,我还需要服务器上至少Oracle Instant Client,因为某些DLL OCI8需要。

What I did? 我做了什么?

  • downloaded Oracle Instant Client from their sites ( oracle download site ), version 11.2.0.4.0 从他们的站点( oracle下载站点 )版本11.2.0.4.0下载了Oracle Instant Client
  • unpacked into folder, I choosed Program Files/oci_11_2 解压缩到文件夹中,我选择了Program Files / oci_11_2
  • added to windows variable path the address 添加到windows变量路径的地址
  • restarted Win 重启Win
  • downloaded php_oci8 libraries from PECL ( PECL oci8 dl site ) 从PECL( PECL oci8 dl网站 )下载了php_oci8库
  • put them into the ext directory set in php.ini 把它们放到php.ini中设置的ext目录中
  • added extension=php_oci8.dll into php.ini 将extension = php_oci8.dll添加到php.ini中
  • restarted apache 重启apache

After all this I checked php_info to see, if everything is ok, however no signs of oci8. 毕竟我检查了php_info看看,如果一切正常,但没有oci8的迹象。

I tried older Oracle instant client, swtiching between php_oci8.dll, php_oci8_11g.dll or php_oci8_12c.dll, yet nothing helped. 我尝试了较旧的Oracle即时客户端,在php_oci8.dll,php_oci8_11g.dll或php_oci8_12c.dll之间切换,但没有任何帮助。

I found, that due to php_info in environment section doesn't show the same values, as one that are set in windows. 我发现,由于环境部分中的php_info没有显示与Windows中设置的值相同的值。 From php error log I also got following: 从php错误日志我也得到以下:

[30-May-2014 08:02:16 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Program Files\\Zend\\ZendServer\\lib\\phpext\\php_oci8_11g.dll' - The specified module could not be found. [30-May-2014 08:02:16 UTC] PHP警告:PHP启动:无法加载动态库'C:\\ Program Files \\ Zend \\ ZendServer \\ lib \\ phpext \\ php_oci8_11g.dll' - 指定的模块不能找到。 in Unknown on line 0 在第0行的未知中

Currently, I have no idea what to do, unless trying reinstalling php(which I don't want to because of many problematics connected with that), different Oracle instant clients or differenct php_oci8 libraries. 目前,我不知道该怎么做,除非尝试重新安装php(我不想因为与之相关的许多问题),不同的Oracle即时客户端或不同的php_oci8库。 I google for some hours, tried looking on Stack, but no solution, just some tips, that didn't help. 我谷歌几个小时,尝试在堆栈,但没有解决方案,只是一些提示,没有帮助。 Have someone encountered and solved something similar? 有人遇到并解决了类似的问题吗?

I have Same Issue, Following steps helped me out. 我有同样的问题,以下步骤帮助了我。

  1. Download instantclient and place "C:\\instantclient_11_2" 下载instantclient并放置“C:\\ instantclient_11_2”
  2. Set environment variable for C:\\instantclient_11_2 为C:\\ instantclient_11_2设置环境变量
  3. Check your php version ie PHP Version 5.6.15 检查你的PHP版本,即PHP版本5.6.15
  4. Form http://pecl.php.net/package/oci8 download exact version, for me its php_oci8-2.0.8-5.6-nts-vc11-x86.zip, unzip it and copy php_oci8_11g.dll to php ext folder, for me its "C:\\xampp\\php\\ext" 表格http://pecl.php.net/package/oci8下载确切的版本,对我来说它的php_oci8-2.0.8-5.6-nts-vc11-x86.zip,解压缩并将php_oci8_11g.dll复制到php ext文件夹,我的“C:\\ xampp \\ php \\ ext”
  5. Un-Comment "extension=php_oci8_11g.dll" in php.ini and restart apache 在php.ini中取消注释“extension = php_oci8_11g.dll”并重启apache
  6. check php_info(), oci8 should be enabled. 检查php_info(),应该启用oci8。

    Thats all. 就这样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM