在我的 WAMP 服务器上安装 php 的 ingres 扩展
我有一台开发计算机,在 Windows 下运行。
对于一个项目,我必须创建一个必须连接到 Ingres 数据库服务器的 php 网站。
所以我安装了wamp,我安装了ingres(服务器和客户端,在我的本地计算机上)。
我在 C:\wamp\bin\php\php5.3.5\ext
文件夹中添加了在其网站上找到的库(php_ingres.dll
),然后添加了配置文件中的一行“extension=php_ingres.dll
”。
我关闭 wamp 并重新启动它,然后重新启动服务器,我现在在 wamp 菜单中看到一个复选标记,表明 php_ingres 现已激活。但是当我进入服务器的欢迎页面时,我没有看到此扩展已加载。如果我进入 php 信息页面,我在配置命令中看不到任何 Ingres 条目。
我只是找不到任何 post/tutorial/...
来指示如何执行此操作,因此任何帮助将不胜感激!
谢谢你!
编辑:我做了一个小测试,看看是否可以连接到 Ingres 数据库:
<?php
$link = ingres_connect("localhost", "demodbtest", "demodbtest") or die("Connexion impossible");
echo "Connexion réussie";
$result = ingres_query($link,"select * from airline");
while ($row = ingres_fetch_array($result)) {
echo $row["al_iatacode"]; // utilisation du tableau associatif
echo $row["al_name"];
echo $row["al_ccode"]; // utilisation du tableau à indices numériques
echo "</br>";
}
ingres_close($link);
?>
我收到此错误:
( ! ) 致命错误:调用未定义的函数 ingres_connect() C:\wamp\www\tests\index.php 第 2 行
有关我的安装的一些信息: 我有 Windows 7 Pro 32 位 Wampserver 2.1 ( http://sourceforge.net/projects/wampserver/files/WampServer%202/WampServer%202.1/WampServer2.1e-x32.exe/download ) 阿帕奇2.2.17
PHP 5.3.5
Ingres 10.1.0 社区版(此处下载:http://esd.ingres.com/product/Community_Projects/Ingres_Database/Windows_32-Bit/Ingres_10.1_Build_121/ingres-10.1.0-121-gpl-win-x86-NoDoc.zip/http< /一>) PHP 驱动程序在此处下载: http://esd.ingres.com/product/驱动程序/PHP/Windows_32位/PHP_Driver
I've a development computer, which runs under windows.
For a project, I've to make a php website which has to connect to an Ingres database server.
So I installed wamp, I installed ingres(server and client, on my local machine).
I added the library that I found on their site(php_ingres.dll
) in the C:\wamp\bin\php\php5.3.5\ext
folder, and I added a line "extension=php_ingres.dll
" in the configuration file.
I shutdown wamp and restarted it, and I restarted the server, I see now a check mark in the wamp menu, indicating that php_ingres is now activated. But when I go to the welcome page of the server, I don't see this extension as loaded. If I go on the php info page, I don't see any Ingres entry in the Configure Command.
I just can't found any post/tutorial/...
which indicating how to do this operation, so any help would be appreciated!
Thank you!
Edit: I made a small test to see if I can connect to an Ingres database:
<?php
$link = ingres_connect("localhost", "demodbtest", "demodbtest") or die("Connexion impossible");
echo "Connexion réussie";
$result = ingres_query($link,"select * from airline");
while ($row = ingres_fetch_array($result)) {
echo $row["al_iatacode"]; // utilisation du tableau associatif
echo $row["al_name"];
echo $row["al_ccode"]; // utilisation du tableau à indices numériques
echo "</br>";
}
ingres_close($link);
?>
And I get this error:
( ! ) Fatal error: Call to undefined function ingres_connect() in
C:\wamp\www\tests\index.php on line 2
Some information on my installation:
I've a windows 7 pro 32bits
Wampserver 2.1 ( http://sourceforge.net/projects/wampserver/files/WampServer%202/WampServer%202.1/WampServer2.1e-x32.exe/download )
Apache 2.2.17
PHP 5.3.5
Ingres 10.1.0 Community edition( downloaded here: http://esd.ingres.com/product/Community_Projects/Ingres_Database/Windows_32-Bit/Ingres_10.1_Build_121/ingres-10.1.0-121-gpl-win-x86-NoDoc.zip/http )
PHP drivers downloaded here: http://esd.ingres.com/product/drivers/PHP/Windows_32-Bit/PHP_Driver
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要实际测试扩展是否已加载,您也可以调用它的函数之一。如果扩展已加载,则不应因缺少函数而收到致命错误。这也许是最快的检查之一。
另一种检查是使用
extension_loaded
*PHP 手册**< /a> 这将为您提供所有已加载扩展的列表。有关详细信息,请参阅上面的 PHP 手册链接。配置行
配置行不会显示 ingres 扩展,因为它还没有被编译。这完全没问题,因为你将它作为扩展加载 (
.dll
),所以它不是php 的一部分.exe
。这就是为什么您在配置行中看不到它的原因。在 phpinfo() 页面上找到
ingres
。在
phpinfo()
页面上,使用浏览器内的搜索功能(通常是CTRL+F
)并尝试找到单词ingres
。您应该找到一个显示扩展默认设置(如果已加载)的部分。以下是 xdebug 扩展的示例屏幕截图。对于 ingres 来说,这可能看起来类似:
图片来自: 在 Eclipse 中启动 xdebug 卡住57% - 如何排除故障?
To practically test if the extension was loaded you can as well call one of it's functions. If the extension was loaded, you should not get a fatal error for a missing function. That's perhaps one of the quickest checks.
Another check is to make use of
extension_loaded
*PHP Manual** which will give you a list of all loaded extensions. See the PHP Manual link above for more info.The configure line
The configure line will not show the ingres extension because it has not been compiled in. That's perfectly alright because you load it as an extension (
.dll
) so it's not part ofphp.exe
. This is why you don't see it in the configure line.Locating
ingres
on the phpinfo() page.On the
phpinfo()
-page use the search function inside your browser (oftenCTRL+F
) and try to locate the wordingres
. You should locate a section that displays the extensions default settings if it has been loaded.The following is an example screenshot for the xdebug extension. This might look similar for ingres:
Image from: Launching xdebug in Eclipse stuck at 57% - How to trouble-shoot?
仔细检查您的
extension_dir
设置以及实际使用的php.ini
文件。如果通过 Apache(或 IIS)在脚本中执行phpinfo()
,则从命令行调用php.exe -i
可能不会给出相同的输出。事实上 http://www.wampserver.com/en/faq.php 说是 3 个潜在的php.ini
脚本。Double check your
extension_dir
setting as well as the actualphp.ini
file being used. Callingphp.exe -i
from the command line might not give the same output if executingphpinfo()
in a script via Apache (or IIS). In fact http://www.wampserver.com/en/faq.php says there are 3 potentialphp.ini
scripts.问题是我没有在本地安装 ingres 客户端,所以看来这个库没有它就无法工作
The problem is that I wasn't having the ingres client installed locally, so it appears that this lib cannot works without it