Page 1 of 1

problem with PDO

Posted: Mon Jan 25, 2010 5:09 pm
by dev-amany
Hi
I am a new php developer and making my 1st PDO connection.

I am working on Windows platform, I have PHP 5.2.9 running on Apache server with MySQL 5.1.32.

I activated the following modules in the php.ini :
extension=php_pdo.dll
extension=php_mysql.dll
extension=php_pdo_mysql.dll

I am trying to create a new PDO object by the following line :
$db = new PDO("mysql:dbname=schema;host=localhost","user", "password");

when I run the project a Fatal error is thrown :
"Class 'PDO' not found in .....(the file path in local disk)........... "

I don't know how to fix the problem, can anyone help?
thanks in advance

yours
Amany

Re: problem with PDO

Posted: Tue Jan 26, 2010 1:05 am
by Christopher
I don't think you need extension=php_pdo.dll or extension=php_mysql.dll in 5.3. Create a script with phpinfo(); in it to see you configuration and if PDO is loading. Also make sure that MySQL is working. I think you need to load the mysql lib somewhere too (Apache? PHP?)

Re: problem with PDO

Posted: Tue Jan 26, 2010 7:59 am
by dev-amany
arborint wrote:I don't think you need extension=php_pdo.dll or extension=php_mysql.dll in 5.3. Create a script with phpinfo(); in it to see you configuration and if PDO is loading. Also make sure that MySQL is working. I think you need to load the mysql lib somewhere too (Apache? PHP?)
thank your Arborint for your reply. Actually I'm using PHP 5.2, but I managed to fix the problem thank you.... The problem was that the file system I unzipped the extensions and set the server pointing to is different than the one needed by PHP which is realized when I made phpinfo();

Thank you so much