0

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

Passerby
  • 9,715
  • 2
  • 33
  • 50
Mike
  • 21
  • 4
  • Do you have mysql and mysql-server installed? – Igbanam Dec 18 '14 at 08:27
  • possible duplicate of [PHP Fatal error: Class 'PDO' not found](http://stackoverflow.com/questions/11813381/php-fatal-error-class-pdo-not-found) – Rikesh Dec 18 '14 at 08:28
  • possible duplicate of [PHP Fatal error: Class 'PDO' not found](http://stackoverflow.com/questions/6012881/php-fatal-error-class-pdo-not-found) – TobiMcNamobi Dec 18 '14 at 08:33
  • mysql and mysql-server are installed and working fine. However, I read over a possible duplicate issue link listed above by Rikesh and Tobi... – Mike Dec 19 '14 at 08:35
  • I checked to see if some of my old mysql connections in php that do not use PDO, and they were failing as well, So, I went back to an old php.ini file, and is back online, doing some more testing with PDO, but to get right results, but I am not getting the PDO error anymore. Thanks everyone for help so far, I will update any solutions or if I have further issues in a few! Cheers! – Mike Dec 19 '14 at 08:39

0 Answers0