Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-09-18
7
Medium Priority
?
1,210 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
This article discusses how to implement server side field validation and display customized error messages to the client.
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 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

636 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