Reputation: 9658
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?
Upvotes: 6
Views: 30729
Reputation: 2697
In the terminal type:
php -i |grep PDO
The -i
is used to display the output of phpinfo().
The |grep
will filter the list to the ones containing PDO.
Upvotes: 1
Reputation: 72682
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.
Upvotes: 29