Solved

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

Posted on 2011-09-18
7
1,115 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
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 is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now