[Solved] Fatal error: Class 'PDO' not found

#1
I wonder if anyone can help me, I'm running a cPanel server with LiteSpeed - EasyApache integration is enabled, and I've also generated a matching PHP binary using the LiteSpeed panel.

But on my site that runs Piwik for stats I get this error

Code:
Fatal error: Class 'PDO' not found in /home/stats/public_html/stats/core/Db/Adapter/Pdo/Mysql.php on line 22
Could anyone please advise or tell me how to fix this, I've tried rebuilding many times but every time I check PHP Info page PDO is not running. I'm lost for ideas and if anyone could share some or how to solve this I would be grateful.
 
#3
make sure you check PDO in Exhaustive Options List when do EasyApache (Apache Update).
Hi,

This is ticked and it appears in the configure command, but PDO is not enabled/does not work/doesnt have its own section in the phpinfo() hence its not loading or something?
Configure Command './configure' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-wddx' '--enable-zend-multibyte' '--enable-zip' '--prefix=/usr/local' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mime-magic' '--with-mm=/opt/mm/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-tidy=/opt/tidy/' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr' '--with-litespeed'
 
Last edited:

webizen

Well-Known Member
#4
since pdo is built as shared module (with option '--enable-pdo=shared'), you need to make sure line 'extension=pdo.so' is placed in php.ini. to find out which php.ini is in use, do following from command line
/usr/local/lsws/fcgi-bin/lsphp5 -i | grep "Loaded Configuration File"
or look for "Loaded Configuration File" in phpinfo page.
 
#5
since pdo is built as shared module (with option '--enable-pdo=shared'), you need to make sure line 'extension=pdo.so' is placed in php.ini. to find out which php.ini is in use, do following from command line


or look for "Loaded Configuration File" in phpinfo page.
root@server[~]# /usr/local/lsws/fcgi-bin/lsphp5 -i | grep "Loaded Configuration File"
Loaded Configuration File => /usr/local/lib/php.ini


Heres the output of php.ini

http://pastebin.com/XJY0yv0E
 
Top