Solved

Class 'PDO' not found in C:\wamp\www\mvc\libs\Database.php

Posted on 2011-09-18
7
1,174 Views
Last Modified: 2013-12-13
on wamp
in php.ini
I uncommented
extension=php_pdo_mysql.dll
and restarted server


class Database extends PDO{
parent::__construct();
}


Class 'PDO' not found in C:\wamp\www\mvc\libs\Database.php



creating a class called PDO{}
fixes the error
but I want to call the real PDO

what else should I do
0
Comment
Question by:rgb192
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 10

Expert Comment

by:acbxyz
ID: 36557224
pdo_mysql is only the mysql-driver for pdo. You also need pdo itself.
Here on linux it is:
extension=pdo.so

You can use phpinfo(); to show which modules are activated.
0
 

Author Comment

by:rgb192
ID: 36557335
i am using wamp

phpinfo()

cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-snapshot-template=d:\php-sdk\snap_5_2\vc6\x86\template" "--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared"



extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll



does this mean that pdo is installed/enabled.
0
 
LVL 10

Expert Comment

by:acbxyz
ID: 36557387
if you put phpinfo() in a file.php and open it in a browser, there should be a section called PDO, which says PDO support enabled.
pdo.png
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:rgb192
ID: 36557830
those sections are not there

what do I have to do to enable pdo in windows apache mysql php
0
 
LVL 10

Accepted Solution

by:
acbxyz earned 500 total points
ID: 36563257
I just installed a WAMPSERVER2.1 from http://www.wampserver.com/en/download.php myself and started it. Without any changes to configuration, pdo was enabled by default, including pdo_mysql and pdo_sqlite.
So I started an up to date xampp for windows and there is pdo with mysql, odbc, sqlite and sqlite2 enabled by default.
Both have a phpinfo()-page by default in their config menu (tray icon with wampserver, http://localhost/xampp/ on the other).
0
 

Author Comment

by:rgb192
ID: 36563922
I am using wampserver 2.0
0
 

Author Closing Comment

by:rgb192
ID: 37128946
I will use wampserver 2.1 now
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question