0

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

J4N
  • 19,480
  • 39
  • 187
  • 340
  • Okay, the fatal error means that the extension is not loaded. Which windows version are you using, look as well for 32 or 64bit. The extension must be compatible with your PHP version, so please add a link to the site where you downloaded your WAMP and the extension. – hakre Jul 18 '11 at 13:28
  • I added these information on the main post – J4N Jul 18 '11 at 13:38
  • Please double check you edited the right PHP.ini file. Then enable error logging to make PHP write errors to a log file. This will log startup errors as well. Check the logfile if PHP complains about loading the extension. Sometimes extensions depend on other extensions, so the order how they appear in the PHP.ini is important (don't know any specifics here for ingres, sorry, so just saying). Hopefully this helps you to get a step ahead. – hakre Jul 18 '11 at 13:45
  • I've the error_reporting = E_ALL and my extension=php_ingres.dll is on the last line of the extension references :/ (and I the log file is non-existant when I try to display it through wamp :s) – J4N Jul 18 '11 at 13:51
  • Startup errors will only be available in the php error log file. You need to configure it probably. It's a setting within your php.ini. search for `error_log` and give it a path like `c:\phperror.log`. You should then find that file. – hakre Jul 18 '11 at 13:54

3 Answers3

0

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 of php.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 (often CTRL+F) and try to locate the word ingres. 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:

Successfully installed xdebug extension (Screenshot) Image from: Launching xdebug in Eclipse stuck at 57% - How to trouble-shoot?

Community
  • 1
  • 1
hakre
  • 193,403
  • 52
  • 435
  • 836
  • Good to know, but the only place where I can find "ingres" is in environnement variable in path. I forgot to mention that I've made a small test, I edit my post right now – J4N Jul 18 '11 at 13:23
  • okay you're calling from commandline. that's probably more easy/quickly for figuring out what's wrong. `php --re ingres` should give you an error as well until the extension is available. Use `php --ini` to display the ini files and check yours is in there. If it is it means the extension is not loading, which either is a wrong configuration or the extension can not be loaded. the php error log is helpful then. – hakre Jul 18 '11 at 14:00
  • I double-checked, I've only one php.ini file, which is in the same folder than the php.exe(used for the CLI and the web execution) – J4N Jul 21 '11 at 08:47
0

Double check your extension_dir setting as well as the actual php.ini file being used. Calling php.exe -i from the command line might not give the same output if executing phpinfo() in a script via Apache (or IIS). In fact http://www.wampserver.com/en/faq.php says there are 3 potential php.ini scripts.

grantc
  • 1,703
  • 12
  • 13
  • I opened the one which is displayed by wamp when I click on the php.ini item in the wamp menu, so I suppose it's the good one(and wamp see it checked) – J4N Jul 21 '11 at 08:49
  • in addition, I added another extension(support of mssql), in the same configuration file, and it works, so I suppose I'm editing the good file – J4N Jul 21 '11 at 08:49
  • so if you execute ´php -c -m´ you don't see ingres listed? – grantc Jul 21 '11 at 15:39
  • Microsoft Windows [version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. Tous droits réservés. C:\Users\julien>C:\wamp\bin\php\php5.3.5\php.exe -c C:\wamp\bin\php\php5.3.5\php.ini -m [PHP Modules] bcmath calendar com_dotnet Core ctype date dom ereg filter ftp gd hash iconv json libxml mbstring mcrypt mhash mysql mysqli mysqlnd odbc pcre PDO pdo_mysql pdo_sqlite Phar Reflection session SimpleXML SPL sqlsrv standard tokenizer wddx xdebug xml xmlreader xmlwriter zip zlib [Zend Modules] Xdebug C:\Users\julien> – J4N Jul 22 '11 at 07:20
  • So no, there is no ingres loaded – J4N Jul 22 '11 at 07:20
  • Is there a php_ingres.dll located in the directory for: C:\wamp\bin\php\php5.3.5\php.exe -c C:\wamp\bin\php\php5.3.5\php.ini -r "ini_get('extension_dir');" and C:\wamp\bin\php\php5.3.5\php.ini contains the line: extension=php_ingres.dll – grantc Jul 26 '11 at 16:03
0

The problem is that I wasn't having the ingres client installed locally, so it appears that this lib cannot works without it

J4N
  • 19,480
  • 39
  • 187
  • 340