Skip to content

hervems/tuto-pecl-extensions-for-php7

Repository files navigation

Tutorials to create PECL extensions for PHP 7 and more

This version #1 contains a simple function confirm_helloworld_compiled.

Generate a skeleton

To generate a skeleton of a pecl extension, you can use the binary ext_skel presents in PHP sources (directory : ext/), example:

./ext_skel helloworld

Compile the extension

  • The first step is to use phpize:
phpize
  • The second step is to launch configure:
./configure
  • The third step is to compile it:
make

Launch phpt tests

The last step is to launch tests:

make test

I added a phpt test in tests/ directory named tests/002.phpt.

Launch php

You can find a helloworld.php which can be launch with php.sh like that:

./php.sh helloworld.php

Clean the repository

To clean your repository, you can use:

make clean
phpize --clean

About

Tutorials to create PECL extensions for php 7 and +

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published