Whilst developing a PHP extension recently I spent quite a bit of time researching exactly how to create an extension, the best practices and the DocBook format of the PHP manual for documenting the extension.
By the time I finished writing the extension I had found some very good resources both on the web and in print.
Online articles and presentations:
- The Internals section of the PHP manual
- Kristina Chodorow's PHP Extensions Made Eldrich on her blog in 2011:
- Sara Golemon's Zend DevZone articles with parts I, II and III (2005, 2006):
- Wez Furlong's Extending PHP slides
- Marcus Börger and Johannes Schlüter: PHP Extension Writing slides
- O'Reilly Programming PHP Chapter 14: Extending PHP
- Paul Osman's Wrapping C++ Classes in a PHP Extension article on Zend DevZone
Documenting PHP and PECL extensions:
Pyrus can also be used to package your extension up for release using the pickle command.
Whilst not strictly for PHP extensions the Autotools: a practitioner's guide to Autoconf, Automake and Libtool book by John Calcote on the Free Software Magazine is very useful reading for an understanding of the build process involved in extension writing.
This article has been updated a number of times as it is reasonably popular and new resources have become available since it was written.
Since writing this article a new Wiki article has been added on php.net with a list of resources. Some of which I have not already covered here.