Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Php pdo extension?

  1. #1
    Join Date
    Jan 2009
    Beans
    39

    Php pdo extension?

    I have a fresh install of Ubuntu Server 9.10 64bit. I chose the LAMP server (and others, but thats not important).

    So I need sqlite support now. So I did sudo apt-get install sqlite.

    But sqlite doesn't work with php yet. I know that pdo and pdo_sqlite modules are needed. But how to get those? If I use pecl install pdo and pecl install pdo_sqlite, and add those as pdo.so and pdo_sqlite.so to the php.ini file, it doesn't work. I get an error like this:

    Code:
    PHP Fatal error:  PDO: driver sqlite2 requires PDO API version 20060511; this is PDO version 20060409 in Unknown on line 0
    So I uninstalled the pecl modules, and I am stuck here. How do I get sqlite working with my php?

    Edit: If I uninstall all the pdo modules (and remove their respective entries from php.ini), apache/php works fine.
    Last edited by ubuntüser; November 3rd, 2009 at 04:58 AM.

  2. #2
    Join Date
    Jan 2007
    Location
    Netherlands
    Beans
    76
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Php pdo extension?

    did you install php5-sqlite package?
    Registered Linux user #428992

  3. #3
    Join Date
    Jan 2009
    Beans
    39

    Re: Php pdo extension?

    Ok. I have done the following:

    Installed LAMP server and Ubuntu server 9.10 64bit

    Installed the following packages:
    Code:
    sudo apt-get install libmysqlclient15-dev
    sudo apt-get install sqlite
    sudo apt-get install php5-sqlite
    Built the following from pecl:

    Code:
    sudo pecl install pdo
    sudo pecl install pdo_sqlite
    Added the following to php.ini (in /etc/php5/apache2/php.ini)

    Code:
    extension=pdo.so
    extension=pdo_sqlite.so
    extension=sqlite.so
    and in that order.

    The builds from pecl were OK too.

    What's wrong? Any ideas?

    I get the following from /var/log/apache2/error.log

    Code:
    PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/pdo_mysql.so' - /usr/lib/php5/20060613/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP Warning:  Module 'pdo_sqlite' already loaded in Unknown on line 0
    PHP Warning:  Module 'SQLite' already loaded in Unknown on line 0
    PHP Fatal error:  PDO: driver sqlite2 requires PDO API version 20060511; this is PDO version 20060409 in Unknown on line 0
    PHP Fatal error:  Unable to start SQLite module in Unknown on line 0
    Is anything form LAMP conflicting?

    Basically, what I want is functional Apache2, PHP, MySQL, and Sqlite support
    Last edited by ubuntüser; November 3rd, 2009 at 10:30 PM.

  4. #4
    Join Date
    Apr 2008
    Location
    Portugal & Ireland
    Beans
    15
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Php pdo extension?

    By the error msg.

    Is the file really there: /usr/lib/php5/20060613/pdo_mysql.so ?

  5. #5
    Join Date
    Jan 2009
    Beans
    39

    Re: Php pdo extension?

    Yeah, the files are all there. The pdo.so, pdo_mysql.so, and sqlite.so are all there. But it's not working.

  6. #6
    Join Date
    Jan 2009
    Beans
    39

    Re: Php pdo extension?

    If I enable the extension_dir="./" in the php.ini file, then I do not get the errors on apache2 startup. It seems to function fine. BUT THERE IS NO SQLITE SUPPORT!? When I try to use pdo, I get

    Code:
    Fatal error: Class 'PDOStatement' not found in /var/www/wtorrent/lib/cls/PDOe.cls.php on line 13

  7. #7
    Join Date
    Jan 2009
    Beans
    39

    Re: Php pdo extension?

    In the process of removing/installing all these things, my LAMP got messed up. PHPMyAdmin said that mysqli extension was missing. It had worked before. So I thought I messed something up in the proess of all this. So what I did:

    Code:
    sudo apt-get --purge remove apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl libpq5 mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 php5-common php5-mysql
    
    sudo tasksel install lamp-server
    
    sudo apt-get install phpmyadmin
    And now, I'm not using rtorrent/wtorrent anymore. Im using torrentflux-b4rt. It was too hard getting mysqli to work with apache2.

  8. #8
    Join Date
    Dec 2007
    Beans
    5

    Re: Php pdo extension?

    I have the same problem. After upgrading to Ubuntu 9.10 from 9.04. I start seeing this error message.

    Code:
    php -v 
    PHP Fatal error:  PDO: driver sqlite requires PDO API version 20060511; this is PDO version 20060409 in Unknown on line 0
    PHP Fatal error:  Unable to start pdo_sqlite module in Unknown on line 0
    I have the :
    pecl list
    Installed packages, channel pecl.php.net:
    =========================================
    Package Version State
    PDO 1.0.3 stable
    PDO_MYSQL 1.0.2 stable
    xdebug 2.0.5 stable



    I have the usual php packages also installed (mysql, dev, etc )

    Regards

  9. #9
    Join Date
    Jun 2007
    Location
    Madison, WI
    Beans
    13

    Re: Php pdo extension?

    I am also seeing the same issue, has anyone figured this out yet? I am also running 9.10.

  10. #10
    Join Date
    Mar 2010
    Beans
    2

    Re: Php pdo extension?

    uninstall php5-sqlite and use the sqlite from pecl

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •