From the fine folks at DevArticles.com this morning, we have a new piece about creating custom PHP extensions for your PHP distribution. The tutorial assumes that you have a basic level of C and a knowledge of the Visual C++ compiler to create these extensions, but I'm sure there's other ways to compile and create them. So, what are extensions exactly?
A PHP extension, in the most basic of terms, is a set of instructions (i.e. code) that is designed to add functionality to PHP. For example, the widely used GD library (used for the creation of dynamic images) is an extension.
Some of the basics that they start you off with is just a simple "Hello World" extension that mainly shows you how to start a project, link in all of the needed resources and use some of the simple functions to echo out the text above. They give you the basic code for this one, and show you how to load it into your PHP distribution (dynamically) and use it in a script. This article is just the first part in the series, so there's not much more to it than that - but in future parts, they plan to introduce how to use functions, memory allocation and management, and using some of the Zend engine macros in your homegrown extensions.




