PHP 5.1.4 PDO Problem...
Posted: 2006-07-07 14:18
Hallo,
ich habe hier auf einem Suse 9.3 System PHP 5.1.4 als CGI kompiliert und installiert. Alles funktioniert nun schon eine ganze Weile ohne Probleme. Heute ist mir aufgefallen das die PDO-Extension nicht mit MySQL zu laufen scheint (Fatal Error). Daraufhin habe ich mir meine PHP Konfiguration noch einmal angeschaut und dabei entdeckt, daß der PDO-Support zwar enabled ist, aber nur der sqlite 2 driver installiert zu sein scheint. Wie kann ich das ändern? Hat jemand einen Tipp?
MfG Andreas
Meine PHPinfo: http://gluecksritter.doc4pc.de/phpinfo.php
Mein PDO-Code:
Die Fehlermeldung, welche beim Aufruf von PDO-Funktionen erscheit:
Mein PHP configure:
ich habe hier auf einem Suse 9.3 System PHP 5.1.4 als CGI kompiliert und installiert. Alles funktioniert nun schon eine ganze Weile ohne Probleme. Heute ist mir aufgefallen das die PDO-Extension nicht mit MySQL zu laufen scheint (Fatal Error). Daraufhin habe ich mir meine PHP Konfiguration noch einmal angeschaut und dabei entdeckt, daß der PDO-Support zwar enabled ist, aber nur der sqlite 2 driver installiert zu sein scheint. Wie kann ich das ändern? Hat jemand einen Tipp?
MfG Andreas
Meine PHPinfo: http://gluecksritter.doc4pc.de/phpinfo.php
Mein PDO-Code:
Code: Select all
function OpenDB ($dsn){
try{
$this->db = new PDO($dns);
}
catch(PDOExeption $e){
echo "Fehler beim öffnen der Datenbank";
}
}
function CreateMenuFromDB (){
OpenDB ("mysql:host=localhost;dbname=xxxx");
}
Code: Select all
Fatal error: Uncaught exception 'PDOException' with message 'invalid data source name' in /home/httpd/vhosts/doc4pc.de/subdomains/gluecksritter/httpdocs/css-dopdown.class.php:122 Stack trace: #0 /home/httpd/vhosts/doc4pc.de/subdomains/gluecksritter/httpdocs/css-dopdown.class.php(122): PDO->__construct('') #1 /home/httpd/vhosts/doc4pc.de/subdomains/gluecksritter/httpdocs/css-dopdown.class.php(113): CSSMenuBuilder->OpenDB('mysql:host=loca...') #2 /home/httpd/vhosts/doc4pc.de/subdomains/gluecksritter/httpdocs/css-dopdown.class.php(207): CSSMenuBuilder->CreateMenuFromDB() #3 {main} thrown in /home/httpd/vhosts/doc4pc.de/subdomains/gluecksritter/httpdocs/css-dopdown.class.php on line 122Code: Select all
make distclean
./configure
--prefix=/usr
--with-config-file-path=/etc/php5
--with-_lib=lib64
--enable-cli
--enable-bcmath
--enable-calendar
--enable-ctype
--enable-dbase
--enable-discard-path
--enable-exif
--enable-filepro
--enable-force-cgi-redirect
--enable-discard-path
--enable-ftp
--enable-inline-optimization
--enable-magic-quotes
--enable-memory-limit
--enable-safe-mode
--enable-shmop
--enable-sigchild
--enable-track-vars
--enable-trans-sid
--enable-wddx
--enable-sqlite
--enable-php-streams
--with-pear
--with-pspell
--with-bz2
--with-dom=/usr/include/libxml2
--with-ftp
--with-gdbm
--with-gettext
--with-gd
--with-zlib-dir=/usr/include
--with-jpeg-dir=/usr/include
--with-png-dir=/usr/include
--with-freetype2=/usr/include/freetype2
--with-freetype-dir
--with-mysql=/usr
--with-mhash
--with-mcrypt
--with-curl
--enable-pdo
#--with-imagick
#--with-t1lib=/usr/include
make && make install