SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP preferring sqlite?

    Hi,

    I've noticed a few things.

    1. MySQL does not come bundled with PHP5 but needs to be compiled in explicitly
    2. I believe sqlite does come by default
    3. In the new PDO extension of 5.1 and later, only pdo_sqlite is the default, not pdo_mysql


    Anyone else noticing a trend? Is PHP moving away from preferring mysql in favor of sqlite, and why so?

    Further, are there any disadvantages to using sqlite over mysql?

    I ask because, as I develop more in PHP5, and use PDO more, I run into the problem of people not having pdo_mysql installed, but in all cases have pdo_sqlite. It's quite frustrating.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by devbanana View Post
    Hi,

    I've noticed a few things.

    1. MySQL does not come bundled with PHP5 but needs to be compiled in explicitly
    2. I believe sqlite does come by default
    3. In the new PDO extension of 5.1 and later, only pdo_sqlite is the default, not pdo_mysql


    Anyone else noticing a trend? Is PHP moving away from preferring mysql in favor of sqlite, and why so?

    Further, are there any disadvantages to using sqlite over mysql?

    I ask because, as I develop more in PHP5, and use PDO more, I run into the problem of people not having pdo_mysql installed, but in all cases have pdo_sqlite. It's quite frustrating.
    Don't know where you heard that. I've never seen PHP not come with the MySQL extension. Every server I've rented, every Windows installer I've used.

    The only reason SQLite is included is because the entire database is self contained. Zend has no license to distribute MySQL, for example, and wouldn't want to anyway.

  3. #3
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you ever compiled PHP yourself? As far as I know mysql has to be manually compiled in in php5, and again the same issue stands regarding pdo. Of course windows installers include mysql because mysql is still veyry popular in PHP. Same goes for rented servers if php was already configured.

    Mysql seemed to be php's database of choice in php4, and so now I wonder why it is different. I'm sure they could've easily made pdo_mysql a default just as well as sqlite, but it isn't.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by devbanana View Post
    Have you ever compiled PHP yourself? As far as I know mysql has to be manually compiled in in php5, and again the same issue stands regarding pdo. Of course windows installers include mysql because mysql is still veyry popular in PHP. Same goes for rented servers if php was already configured.

    Mysql seemed to be php's database of choice in php4, and so now I wonder why it is different. I'm sure they could've easily made pdo_mysql a default just as well as sqlite, but it isn't.
    I've compiled PHP, but only to add to an existing install, not to start fresh. I've used RPM's/yum/up2date in the past, and the repositories I've grabbed PHP from must've included the mysql extension.

    Couldn't you say the same about Postgres, Oracle, or any other RDBMS that there are extensions and PDO drivers for? I'd say this is more a case of not showing preference for one above all others than "moving away" from anything. Considering MySQL doesn't come with PHP, maybe the extension really shouldn't either. SQLite is just a C library that can easily be included with the PHP distribution itself without a commercial license.

  5. #5
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    http://www.php.net/manual/en/faq.dat...ses.mysql.php5

    "This won't actually affect that many people. Unix users, at least the ones who know what they are doing, tend to always build PHP against their system's libmyqlclient library simply by adding the --with-mysql=/usr option when building PHP."

    The main reason MySQL is not bundled or enabled by default is because of the licensing.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  6. #6
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    True enough. I actualy don't care about that because every php5 install i've seen anyway has mysql. But those who compile it tend to overlook the PDO extension and generally don't install pdo_mysql, which again is rather inconvenient, since IMO PDO should probably be used over any other db access library.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd


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
  •