# Php mysql pdo? [solved]

## cwc

Here is my test.php

http://71.80.154.239/test.php

I am trying to enable PDO for a mysql connecttion with a user login.

Here is my error:

Fatal error: Class 'PDO' not found in /home/cwc/html/login/adduser.php on line 61

I'm not sure if I need to install more or enable more in my php.ini

Here is my php.ini

thanks!

```

 Be sure to appropriately set the extension_dir directive.

;

;extension=php_bz2.dll

;extension=php_curl.dll

;extension=php_fileinfo.dll

;extension=php_gd2.dll

;extension=php_gettext.dll

;extension=php_gmp.dll

;extension=php_intl.dll

;extension=php_imap.dll

;extension=php_interbase.dll

;extension=php_ldap.dll

;extension=php_mbstring.dll

;extension=php_exif.dll      ; Must be after mbstring as it depends on it

extension=php_mysql.dll

extension=php_mysqli.dll

;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client

;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client

;extension=php_openssl.dll

extension=php_pdo_firebird.dll

extension=php_pdo_mssql.dll

extension=php_pdo_mysql.dll

extension=php_pdo_oci.dll

extension=php_pdo_odbc.dll

extension=php_pdo_pgsql.dll

extension=php_pdo_sqlite.dll

;extension=php_pgsql.dll

;extension=php_pspell.dll

;extension=php_shmop.dll

; The MIBS data available in the PHP distribution must be installed.

; See http://www.php.net/manual/en/snmp.installation.php

;extension=php_snmp.dll

;extension=php_soap.dll

;extension=php_sockets.dll

;extension=php_sqlite.dll

;extension=php_sqlite3.dll

```

----------

## Veldrin

your php is built without pdo support. just enable the pdo use flag.

V.

----------

## Ant P.

Uncommenting the example Windows DLL extension lines will not work on Linux.

----------

## cwc

woops I might have found one of my problems (  :Smile:  )

pdo and - pdo

add "pdo" and remove "-pdo"

I'll emerge php again.

I changed by php.ini file back to the original and commented the dll's 

No luck.

```

#php

dev-lang/php pdo mysql apache2 berkdb bzip2 cli crypt ctype filter gd gdbm hash iconv json ncurses nls pcre pic posix readline reflection session simplexml snmp spl ssl tokenizer truetype unicode xml xmlreader xmlrpc xmlwriter zip zlib -adabas -bcmath -birdstep -calendar -cdb -cgi -cjk -concurrentmodphp -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -embed -empress -empress-bcs -esoob -exif -fdftk -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd-external -gmp -imap -inifile -interbase -iodbc -ipv6 -kerberos -kolab -ldap -ldap-sasl -libedit -mcve -mhash -msql -mssql  -oci8 -oci8-instant-client -odbc -pcntl -pdo -postgres -qdbm -recode -sapdb -sharedext -sharedmem -soap -sockets -solid -spell -sqlite -suhosin -sybase-ct -sysvipc -tidy -wddx -xpm -xsl -yaz

#apache

www-servers/apache mysql php pam ssl xml xml2 berkdb innodb jpeg png ssl -debug -doc -ldap (-selinux) -static -suexec" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker"

```

----------

## cwc

thanks for you help!

problem solved!  php to mysql script worked with pdo.

thank again!

cwc

----------

## misk001

Thanks that helps a lot.

I did the following:

1) nano /etc/portage/make.conf

2) and in USE=""  section add please use flag:       pdo  

TESTMACHINE# more  /etc/portage/make.conf

CFLAGS="-O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

USE="mmx sse sse2"

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j2"

EMERGE_DEFAULT_OPTS="--jobs=1 --load-average=2.0"

USE="gd -gnome -kde -alsa -cups -qt3 -qt4 fastcgi mysql php curl pdo \

        pam ssl xml xml2 innodb jpeg png pcre session unicode crypt ctype mysqli bzip2 cgi sysvipc"

GENTOO_MIRRORS="http://gentoo.inode.at/"

PHP_INI_VERSION="production"

3) Then: emerge php

it took 20 minutes to complete, but hey it is working !!!

----------

