I need to learn how to develop PHP extensions.
So, I assume I have to refresh my CPP skills (or is it C?).
What IDE should I use (auto-completion, object browsers etc). I plan to develop on Ubuntu 32.
Is there a good book or good website I can learn from?
views:
41answers:
2
A:
php extensions are (mostly) written in pure C.
C programmers on unix most commonly use vim or emacs (iirc).
Sara Golemon's Extending and Embedding PHP is a good book, don't know if it reflects the latest developments though.
stereofrog
2010-04-19 23:30:33
+2
A:
I've recently been learning how to write extensions myself. I'm doing my coding in C++ because I'm exposing some C++ classes I already have written. If you can do it in C, that's suggested as it's the native language of PHP and all the extensions bundled with the PHP source.
Here are the links which I have found most useful in learning or I continue to refer to while developing:
- (Sara Golemon's tutorial, part 1) http://devzone.zend.com/article/1021
- (Sara Golemon's tutorial, part 2) http://devzone.zend.com/article/1022
- (Sara Golemon's tutorial, part 3) http://devzone.zend.com/article/1024
- (Sara Golemon's book "Extending and Embedding PHP" ISBN 978-0-672-32704-9 - site registration required) http://my.safaribooksonline.com/067232704X
- (Wrapping C++ classes in a PHP extension) http://devzone.zend.com/article/4486
- (Building PHP from the source for Apache 2- necessary during development) http://us.php.net/manual/en/install.unix.apache2.php
- (The limited amount of documentation available) http://php.net/internals
- <your PHP source folder>/ext/ contains the source for all the extensions that come with PHP. You will find yourself digging through this code for examples of how they did stuff all the time. Get used to using
grep
to find the source for an existing PHP function that does something you want your code to do.
John Factorial
2010-05-20 16:33:35
no you got 10...
Itay Moav
2010-05-20 16:35:58
ah, looks like it just happened. links fixed :)
John Factorial
2010-05-20 17:16:36