开发环境
linux系统
php源码
生成c扩展并安装
php ./ext_skel.php --ext gradytest
cd gradytest
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config
make
make install
修改php.ini 加入extension=gradytest.so
重启php-fpm
测试扩展
<?php
$res = gradytest_test1();
var_dump($res);
尝试些自己的方法
vim gradytest.c
重复上面步骤,安装扩展测试
之后可以研究php内核原理