如何在 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

查看:19
本文介绍了如何在 php.ini 中启用 oci8 (Oracle) 的扩展 - PHP 警告:PHP 启动:在第 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 数据库,所以我尝试启用一些扩展与 Oracleoci8 相关.

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 文件中,我得到:

3) In php_error.log file I get:

 **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) 我在 Apache 的文件夹中复制了这两个 dll 文件,但它再次不起作用!

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:

配置命令

 "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared"

嗯...我的系统中不存在以下文件夹:

Hm...the following folders do not exist in my system:

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?

谢谢

推荐答案

[SOLVED]

我下载了 Instant Client Package - Basic(版本 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆