Last March I wrote a post about PowWeb’s Secret Price Increases. Well, I just received my latest invoice from them for my 2011 hosting, and guess what? Same story. They charged me $107.40, which works out to $8.95 per month. The regular price shown on their homepage is $7.77 per month. At that rate, my bill should have been $93.24. I must admit this year’s bill is slightly better than last year’s, when they tried to charge me $111.24. But still, it’s a far cry from the so-called regular price they advertise.
[ad name=”Google Adsense 468×60″]

I immediately contacted PowWeb support and requested that they either bill me the correct amount or update their homepage to reflect the price they charged me. They chose to correct my invoice, as they did last year. And I have no doubt I’ll be placing the exact same support request next year.

As far as service and hosting reliability goes, PowWeb performs well for a shared host. Even so, that does not excuse these secret price increases. I could understand if they charged more for added features. Even if they decided to jack up their prices for no reason, I wouldn’t complain if they at least had the decency to inform their customers of the increase. But keeping an inaccurate price on their homepage year after year and hoping customers won’t notice the discrepancy? That’s just wrong.

I would recommend to anyone who is hosting with PowWeb that you check your invoice carefully. If you’re being charged more than $93.24 ($7.77 per month) contact support and tell them to charge you the correct amount, as shown on their homepage. You shouldn’t have to pay more.

Share

I have installed the PHP extension Xdebug on multiple platforms and for some reason I keep forgetting how I manage to do it every time.

Below are the steps I followed to get Xdebug working with Zend Server CE 5.04 with PHP 5.3 on Windows 7 Ultimate 64-bit.

[ad name=”Google Adsense-1-box”]

  1. Download the correct Xdebug extension from here.
    Note: Although I am running a 64-bit OS, Zend Server CE 5.04 is 32-bit and requires 32-bit extensions so I downloaded the 32-bit version of Xdebug php_xdebug-2.1.0-5.3-vc9-nts.dll
  2. Copy the DLL to C:\Program Files (x86)\Zend\ZendServer\lib\phpext\
  3. Add the following lines ABOVE [Zend] in your php.ini file which is located at C:\Program Files (x86)\Zend\ZendServer\etc\php.ini
    [xdebug]
    zend_extension="C:\Program Files (x86)\Zend\ZendServer\lib\phpext\php_xdebug-2.1.0-5.3-vc9-nts.dll"
    
  4. Restart Apache
  5. Log in to the Zend Server GUI at http://localhost:10081/ZendServer and check the PHP Info page for Xdebug
  6. If you have an Xdebug section then it works. Now you’ll want to probably add some more configuration to the [xdebug] section of the php.ini file. See xdebug.org for more info.
Share

The Zend Framework Quick Start tutorial comes with a great example of the type of error handling Zend Framework can do. Any exception that is thrown almost anywhere in your application is caught and handled by the Error Controller. This allows for very customized development and/or user error messages. But what about generic PHP errors? What about PHP notices? It’s really annoying to see a white screen with a single PHP error after you’ve spent so long trying to get your pretty Error Controller handled errors looking so nice.

PHP has a nifty function called set_error_handler which allows you to, well, set the error handler. You provide it a callback function and it calls your function when something bad happens. While it obviously can’t catch all PHP errors, it does a pretty good job of catching most of the little annoying ones.

Below is a way to set your ErrorController as the PHP error handler.

[ad name=”Google Adsense 468×60″]

Add the following method to your Bootstrap.php class.

public function __construct($application) {
    parent::__construct($application);
    MyApp_Error_Handler::set();
}

Add this code to a file called library/MyApp/Error/Handler.php

class MyApp_Error_Handler {
    public static function handle($errno, $errstr, $errfile, $errline) 
    {
        if (!error_reporting()) return;
        throw new Exception($errstr . " in $errfile:$errline". $errno);
    }
        
    public static function set()
    {
        set_error_handler(array(__CLASS__, 'handle'));
    }
}
    

Share

I know I haven’t blogged since August but I have a good excuse. My team and I have been working really hard towards the public beta release of our new online wish list app Wishing Wagon. Basically, Wishing Wagon allows you to create lists of items you would like to receive for a special occasion like Christmas, birthday, wedding, etc. The advantage of Wishing Wagon over other store-based wish lists is that we aren’t store-based. You can add any item you want from any online or physical store.

Since my blog is primarily about technical topics and I’m not sure if promoting my web app can be classified as a miscellaneous rant, I’ll talk a bit about the architecture of Wishing Wagon.

[ad name=”Google Adsense 468×60″]

The site was built using PHP and of course my favourite PHP framework, Zend Framework. For the database, instead of MySQL, this time we decided to use Couch DB. I must say that using documents instead of using relational databases feels so much more natural. Documents fit much better with models and I don’t have to worry about Many-to-Many relationships anymore. Couch DB took a bit of time to get used to, but I am now hooked and will try to use Couch whenever eventual consistency is an option.

During the development of Wishing Wagon, I’ve also come to appreciate the built-in Amazon API support in Zend Framework. Retrieving products and searching for items is a breeze. I was a little surprised at how easy it was.

The site is hosted on Rackspace Cloud and is load balanced using HAproxy. We use Rackspace Cloud files as our CDN and we use the Compass Rackspace Cloud Files Zend Framework Library to upload files to the CDN.

I’ll try to blog a bit more about our development experience in the next few weeks.

Don’t forget Christmas is only 45 days away! Why not create a Wishing Wagon and add some items? Oh, and did I mention it’s free?

Share

If you have never heard of CouchDB here is the first Paragraph from the Apache CouchDB project documentation: A CouchDB server hosts named databases, which store documents. Each document is uniquely named in the database, and CouchDB provides a RESTful HTTP API for reading and updating (add, edit, delete) database documents.
You can also read the free CouchDB book here.

The easiest way to get started is to sign up for a free CouchDB instance here.

In this tutorial I’m going to show you a quick way of getting CouchDb working with Zend Framework.

I’m assuming you already have a Zend Framework project setup if not get the quickstart here.

Since the Zend Framework doesn’t currently support CouchDB a separate library is required.
Matthew Weier O’Phinney has written a nice library that provides most of the functionality required to work with CouchDB. You can download Phly_Couch here. Once downloaded extract it to your projects library directory.

Add this to your application.ini and modify with your info.

couchDb.host  = "username:password@youraccount.couchone.com"
couchDb.db    = "yourdb"
couchDb.port  = 80

Add this method to your Bootstrap.php

    /**
     * Adds configuration to Zend_Registry
     * Retrieval example: Zend_Registry::get('config')->couchDb->db
     * @return Zend_Config
     */
    protected function _initConfig()
    {
        $config = new Zend_Config($this->getOptions());
        Zend_Registry::set('config', $config);
        return $config;
    }

[ad name=”Google Adsense 468×60″]
Use the following code to access your CouchDB instance.

    // Establish connection
    $couch = new Phly_Couch(Zend_Registry::get('config')->couchDb);
       
    // Create a new document
    $testId = uniqid('TEST-',true);
    $document = new Phly_Couch_Document($testId); 
    $document->id = "NewPage"; 
    $document->title = "New Page"; 
    $document->content = "This is a new wiki page!"; 
    $document->created = date('Y-m-d H:i:s'); 
    $document->tags    = array('wiki', 'system');
    $couch->docSave($document);
       
    // Read Document
    $document = $couch->docOpen($testId);
    if ($document->getId() != $testId) throw new Exception("ID's do not match. ID=" . $document->getId());
        
    // Delete a document
    $document = $couch->docRemove($testId,
        array(
            'rev' => $document->getRevision()
    ));

UPDATE:
I had forgotten that I had made some changes to Phly_Couch. I have uploaded the code to Google Code. You can download it here

Share