mikerodent Posted December 20, 2009 Share Posted December 20, 2009 Hi all, (tried a forum search with the title of this posting ... came up with nothing) I am getting a web server and stuff together on my machine. Details: OS: WXP, apache: 2.2.14, php: 5.3.1, mysql: 5.1.41, browser: Firefox 3.5.6. my php/Apache is working fine... I encounter a problem when I try to get my php to connect to a database - on running a php file with the following line: $dbh = new PDO("mysql:host=localhost; dbname=noggindb", "root", "twiddle" ); ... I get the following response exception 'PDOException' with message 'could not find driver' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\noggindb\index.php:10 Stack trace: #0 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\noggindb\index.php(10): PDO->__construct('mysql:host=loca...', 'root', 'twiddle') #1 {main} ... anyone know what this is about? Do you have to explicitly set up a MySQL driver? I haven't seen this in my installation instructions (sitewizard.com)... I assumed one of the .dll files was a driver... php_mysql.dll, or php_mysqli.dll or libmySQL.dll... the latter file is in my MySQL\bin directory... I can't remember whether I copied it there or what... Any advice? Thanks Link to comment https://forums.phpfreaks.com/topic/185788-could-not-find-driver-error/ Share on other sites More sharing options...
jskywalker Posted January 16, 2010 Share Posted January 16, 2010 Look at the results op phpinfo();, and if there is a section named "PDO" in there.. If not, read http://php.net/manual/en/ref.pdo-mysql.php to see how to enable the PDO-extension on your PHP-installation. Link to comment https://forums.phpfreaks.com/topic/185788-could-not-find-driver-error/#findComment-996027 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.