一起来开发个PHP扩展

995 阅读1分钟

Develop a simple PHP extension to learn PHP extension development and the PHP kernel (PHP7)

中文文档

Install the extension

  1. git clone
    git clone github.com/wujunze/pan…
  2. Compilation and installation extension
    $ /path/to/phpize
    $ ./configure --with-php-config=/path/to/php-config
    $ make && make install
  1. Add at last in php.ini
[say]
extension = panda.so
  1. Restart php-fpm

Use the extension

  1. View the extensions installed PHP_ext_Panda.png

  2. So let's test that out Panda-run.png

Special thanks to

  1. 信海龙的博客
  2. 深入理解PHP内核
  3. PHP 扩展开发及内核应用相关内容