Create your own PHP extension (on Windows)

Have you ever thought about writing your own PHP extension? There are surely a few pro’s and con’s about creating PHP extensions to solve problems, rather than write PHP libraries. But this is not the question here. I was curious. So come on Internet, let’s see what you got for me…

Looks a bit outdated, but that’s not the problem here for me. As a matter of fact, I’m currently still using PHP 5.3.5 on my dev for a list of reasons. And I’m using Windows and I don’t complain (I know my colleagues think I’m weird). Luckily both tutorials cover the topic on how to create the extension on Windows for PHP 5.3.5. So much win! And the best: it really works!

Basically both tutorials provide you with everything you need. I had to get over two pitfalls though:

  1. php5ts.lib is not in the source code directory I just extracted, but in my WAMP stack already – in my case I located it in C:\xampp\php\dev
  2. error C2371: ‘socklen_t’ : redefinition; different basic types¬†– I really have no idea why this error came up during compilation. However I was able to “solve” *cough* the problem by commenting out lines 149 to 151 in the php.h:
    #ifndef HAVE_SOCKLEN_T
    typedef unsigned int socklen_t;

    Surely not the ideal solution, but as I just wanted to try it out I don’t mind at the moment.

Microformats – control what Google shows on the Search Results page

Yesterday I learned about “Microformats“. Microwhat? Sounds suspicious!

Well, at least that was my reaction. I’ve to admit that I don’t care much about SEO and Google and so on (I’m a PHP backend developer, Goddamit!), but this is really interesting topic one should at least have heard of. In short, it allows you to have influence on what is displayed on the Google results page. Worth its weight in Gold, I guess. Some of the ancients amongst us might remember the good old Metatags. It’s not the same, though.

So here’s a link that explains Microformats pretty well: