[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-09-18
7
Medium Priority
?
1,224 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

831 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