1

I got error ( Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in C:\wamp\www\test.php on line 30) when i run my php page using wamp server.

First I introduce the technology i used.

1) Adobe dreamviewer CS6

2) WAMP server 2.0

3)IBM Informix 64 bit

Steps i followed

  • Install IBM Informix 64 bit

  • make ODBC connection (System DNS) successsful

  • download php_pdo.dll and php_PDO_Informix.dll and paste these .dll on "C:\wamp\bin\php\php5.4.12\ext"
  • add below lines in php.ini below extension

extension=php_pdo.dll

extension=php_pdo_informix.dll

*create below php code for connection test with IBM informix

<?php  $db = new PDO("informix:host=10.81.32.12; service=1504; 
database=db_cra; server='servername'; protocol=onsoctcp; 
EnableScrollableCursors=1", "Userid", "Pasw") or die("Could not connect to data); ?>
  • restart WAMP server and execute this page

then i got this Fatal error: Uncaught exception 'PDOException' with message 'could not find driver'

Please help..I'm totally new for this Technology, Let me know any thing you require from my side.

user2679336
  • 11
  • 1
  • 3

1 Answers1

0

Perhaps try with a DSN? http://php.net/manual/en/ref.pdo-informix.connection.php

$db = new PDO("informix:DSN=Infdrv33", "", "");

where Infdrv33 is replaced by the name of the System DSN you tested.

Sarah Kemp
  • 2,670
  • 3
  • 21
  • 29
  • this time i got error as Uncaught exception 'PDOException' with message 'invalid data source name' – user2679336 Aug 13 '13 at 17:24
  • Did you change Infdrv33 to the name of your System DSN? – Sarah Kemp Aug 13 '13 at 17:27
  • something is missing in my code or in configuration....but dont know what i missed..... pls help......... – user2679336 Aug 21 '13 at 10:51
  • My only suggestion if you are still seeing 'invalid data source name' is that you made a User DSN not a System DSN. I don't think the problem is in your code or you WAMP configuration, but in the way you are referencing the driver somehow. Either the DSN you created is not available to the webserver user or the name is not quite right. http://www.geeksengine.com/article/mysql-odbc.html – Sarah Kemp Aug 21 '13 at 15:15