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 Responses to “Zend Framework Tutorial for 0.9.1”

  1. 1 Alex

    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:\wamp\www\test\library\Zend\Db\Adapter\Pdo\Abstract.php:79 ...

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

    Thanks in advance and congratz on your great job!

    Alex

  2. 2 Inanc Gumus

    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. 3 lalit

    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.

  4. 4 Rob...

    Lalit,

    I'd guess that you have a different php.ini file used when using apache.

    Regards,

    Rob...

The views expressed in these comments are not the views of the publisher. However, we believe in the rights of others to express their legitimate views and concerns. Any legitimate complaint emailed to rob@akrabat.com will be seriously considered and the post reviewed as desirable and necessary.