Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell if PDO module installed/disabled?

Tags:

php

pdo

I'm developing a PHP application. I just moved a bunch of files over to the production server, to discover that PDO is apparently not installed (Fatal error: Class 'PDO' not found in [file] on line [line]). The prod server is using PHP 5.3.6; according to the documentation I've found, "PDO and the PDO_SQLITE driver is enabled by default as of PHP 5.1.0".

I have very little experience administering PHP. How do I tell if this module is installed but disabled, or absent altogether? And what do I need to do to get it running?

like image 201
BlairHippo Avatar asked Apr 30 '12 18:04

BlairHippo


1 Answers

Generally you can just do phpinfo(); to find out what modules are installed.

Or from the commandline:

php -m

Additionally you could use: class_exists('PDO') to find out whether the PDO class indeed is accessible.

like image 98
PeeHaa Avatar answered Oct 13 '22 12:10

PeeHaa