Pragmatism in the real world

Zend Framework Tutorial for 0.9.1

I’ve finally managed to update my tutorial for version 0.9 of the Zend Framework. Sorry for the delay.

This is a significant reworking of the code to take into account the changes in the framework, so there are bound to be a few typos. If you find any, I’d appreciate it if you could let me know!

4 thoughts on “Zend Framework Tutorial for 0.9.1

  1. Hi,
    Your tutorial is great. However there is something I can't get working and I am posting it in the case other people using your material would face the same problem.

    It deals with the config file.

    I am using MySql and here is my info:
    [general]
    db.adapter = PDO_MYSQL
    db.config.host = localhost
    db.config.username = root
    db.config.password =
    db.config.dbname = test

    Nothing crazy going on here… Here is the related bootstrap part:

    // load configuration
    $config = new Zend_Config_Ini('./application/config.ini', 'general');
    $registry = Zend_Registry::getInstance();
    $registry->set('config', $config);

    // setup database
    $db = Zend_Db::factory($config->db->adapter,$config->db->config->asArray());
    Zend_Db_Table::setDefaultAdapter($db);

    Just like in the tutorial.

    However, here is the error message I get:

    Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The mysql driver is not currently installed' in C:wampwwwtestlibraryZendDbAdapterPdoAbstract.php:79 …

    Is there something I should install, if yes, how?

    Thanks in advance and congratz on your great job!

    Alex

  2. Alex Hi,
    You may try to enable the mysql PDO extension for your web server.

    Enabling just mysql extension without PDO version is not enough.

  3. Hi, I have following setting in config.ini
    db.adapter = PDO_MYSQL
    db.config.host = localhost
    db.config.username = root
    db.config.password =
    db.config.dbname = test

    I am connecting using the code below:
    $config = new Zend_Config_Ini('./application/config.ini', 'general');
    $registry = Zend_Registry::getInstance();
    $registry->set('config', $config);

    // setup database
    $db = Zend_Db::factory($config->db->adapter,$config->db->config->asArray());
    Zend_Db_Table::setDefaultAdapter($db);

    The strange thing is that, I can connect and query using the php cli, but when I accessing my website, I get this error "The mysql driver is not currently installed"

    Please help.

Comments are closed.