News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Abhinav Singh's Blog:
PHP Extensions - How and Why?
December 12, 2008 @ 11:17:23

Abhinav Singh has posted a guide to PHP extensions - what they are and how to write a simple "hello world" one.

Assuming you have read the previous post, lets discuss on how to build our first PHP extension: every PHP extension is built out of minimum of 2 files, a configuration file (config.m4) which tells us what files to build and what external libraries are needed and source File(s) which will contain the actual functionality.

He builds up an example skeleton for an extension (the config.m4) and explains how the file will be phpized and configured. Next up is the php_sample.h header file where the needed modules are loaded and the sample.c file to define them. Last, but not least, comes the extension code itself that calls the printf function to output the "hello world" message.

0 comments voice your opinion now!
extension tutorial header file config phpize helloworld


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: PHP Development on the Facebook Platform: Building Your First App

SitePoint PHP Blog: How to Avoid 404s and Redirect Old URLs in PHP

DevShed: Generating Web Pages with the Flyweight Pattern in PHP 5

PHP-GTK Community Site: GtkToolbar, GtkMenubar, and PEAR XML-RPC for geo-nick

Till Klampaeckel's Blog: So you'd like to migrate from MySQL to CouchDB? - Part II


Community Events





Don't see your event here?
Let us know!


zendserver series list release laravel conference podcast api community tips bugfix framework introduction development language code interview threedevsandamaybe deployment symfony

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework