如何启用在php.ini OCI8(Oracle)的扩展 - PHP的警告:PHP启动:在未知在线0 [英] How to enable extensions for oci8 (Oracle) in php.ini - PHP Warning: PHP Startup: in Unknown on line 0
问题描述
我使用Windows XP,最近我安装WAMP(Apache的MySQL的 - PHP)的32位。
我测试安装(PHP和Apache连接到MySQL数据库),一切都正常工作。
I have Windows XP and recently I installed wamp (apache-mysql-php) 32-bit. I tested the installation (connect to mysql database with php and apache) and everything was working fine.
现在我需要连接到Oracle数据库,所以我试图让一些扩展
相关的甲骨文和 OCI8
Now i need to connect to an Oracle database so I tried to enable some extensions related to Oracle and oci8.
和我所做的:
1)我打开的php.ini 文件,我删除了分号以下行之前:
1) I opened php.ini file and I removed the semicolons before the following lines:
之前:
;extension=php_oci8.dll
;extension=php_oci8_11g.dll
之后:
extension=php_oci8.dll
extension=php_oci8_11g.dll
2)我重新启动Apache和所有的服务,我也得到一个
2) I restarted apache and all Services and i get a
- PHP启动警告。
3)在 php_error.log 文件的获取:
**PHP Warning: PHP Startup: in Unknown on line 0**
所以,我认为这将是一个好主意,检查在我的PHP扩展文件夹
如果这些DLL文件在那里。
So, i thought that it would be a good idea to check where my extension php folder is and if those dll files are there.
在的php.ini 我的扩展文件夹位于:
In php.ini my extension folder is located at:
extension_dir = "C:/wamp/bin/php/php5.4.16/ext/"
文件夹是否存在,以及这两个库(php_oci8.dll php_oci8_11g.dll)
在该文件夹内。
The folder exists and both of these libraries (php_oci8.dll php_oci8_11g.dll) are inside that folder.
4)我在Windows我的路径系统变量以下补充:
4) I added in my 'Path' system variable in Windows the following:
C:\wamp\bin\php\php5.4.16\ext;
5)我复制这两个DLL文件在Apache的文件夹,但再没有工作!
5) I copied both of these dll files in Apache's folder but again it didn't work!
C:\wamp\bin\apache\Apache2.4.4\bin
6)同时,我查了的phpinfo 页,我得到OCI8的唯一入口如下:
6) Also, I checked the phpinfo page and the only entry I get for "oci8" is the following:
Configure命令
"--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared"
唔...以下文件夹中的不存在在我的系统:
C:\php-sdk\oracle\instantclient10\sdk
C:\php-sdk\oracle\instantclient11\sdk
那么,我到底下一步该怎么做,才能正确启用OCI8扩展?
So, what am I supposed to do next in order to correctly enable the oci8 extensions?
感谢
推荐答案
[解决]
我下载了即时客户端软件包 - 基本(10.2.0.5版)和我提取它
I downloaded the Instant Client Package - Basic (version 10.2.0.5) and I extracted it.
后来我复制下列文件夹的包中的所有文件:
Afterwards I copied all the files of that package in the following folders:
C:/wamp/bin/php/php5.4.16/ext/
C:/wamp/bin/apache/Apache2.4.4/bin
它以这种方式为我工作。
在此之后,OCI8模块被加载。
It worked for me in this way. After that the oci8 module was loaded.
这篇关于如何启用在php.ini OCI8(Oracle)的扩展 - PHP的警告:PHP启动:在未知在线0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!