Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timesplinter/php5-ext-template
A basic template for a PHP5 extension
https://github.com/timesplinter/php5-ext-template
Last synced: 29 days ago
JSON representation
A basic template for a PHP5 extension
- Host: GitHub
- URL: https://github.com/timesplinter/php5-ext-template
- Owner: TiMESPLiNTER
- Created: 2015-06-09T14:45:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-11T07:22:50.000Z (over 9 years ago)
- Last Synced: 2023-03-11T18:47:59.791Z (almost 2 years ago)
- Language: C
- Size: 125 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# php5-ext-template
This is a template repository which gives you a skeleton for building a simple PHP5 extension.
It's based on those 3 great blog entries:
* [Extension Writing Part I](http://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/)
* [Extension Writing Part II a](http://devzone.zend.com/317/extension-writing-part-ii-parameters-arrays-and-zvals/)
* [Extension Writing Part II b](http://devzone.zend.com/318/extension-writing-part-ii-parameters-arrays-and-zvals-continued/)
* [Extension Writing Part III](http://devzone.zend.com/446/extension-writing-part-iii-resources/)## Things to replace
There are some things you have to replace in the template file:
`ext_name` and `EXT_NAME` strings in file content and file names should be replaced by the extension name either in lower or upper case.
Pay attention to the `_` in `EXT_NAME` **don't** replace any occurrences of `EXTNAME` (without the underscore).
## Compile the extension
It's the easiest if you store the extension project in `/path/to/php/ext/ext-name`. Then you can do in your extension dir:
* `../../bin/phpize`
* `./configure --enable-ext_name`
* `make` (or `make clean all`)
* `cp ./module/ext_name.so /path/to/php/lib/php/extension/no-debug...`
* In `php.ini` add `extension=ext_name.so`