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
problem with PDO
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: problem with PDO
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?)
(#10850)
Re: problem with PDO
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();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 you so much