I am trying to use PDO on my raspbian(raspberry pi) distro, wheezy, debian. This is the error I get when executing a PDO connection to mysql dbms:
Fatal error: Class '
PDO
' not found in/var/www/labCrawl/Data.php
on line 7
php code that throws error:
$pdo = new PDO(DB_CONN_STRING, DB_USER, DB_PASS);
Also, my code is working fine on my osx machine, but when I put it on my pi, pdo fails to be recognized.
I have ran the following command line and results checded out as listed below:
$ php -i|grep PDO
PDO
PDO support => enabled
PDO drivers => mysql, sqlite
PDO Driver for MySQL => enabled
PDO Driver for SQLite 3.x => enabled
Now, I have checked my php.ini in /etc/php5/apache2 and the following bolded extensions concerning PDO are there:
extension=imap.so
extension=yaz.so
extension=mcrypt.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pdo.so
extension=pdo_mysql.so
Other info, on the pi, there are a whole bunch of .ini
files that are linked through a conf.d directory in /etc/php5/apache2. Files like 20-pdo_mysql.ini
, which all have same content (pretty much nothing, I think!):
; configuration for php MySQL module
; priority=20
extension=pdo_mysql.so
Versions of mysql: Ver 14.14 Distrib 5.5.35, for debian, and php5 ver: 5.4.35-0+deb7u2 (cli)
Can anyone see what I could be missing?
Thanks