PHP 拓展 开发,开发php扩展
centos 6.8
1,安裝gcc
yum -y install gcc make?autoconf
2,下載最新版php源碼
打開eclipse->file ->new -> c project
項目下有個重要的工具,php-src/ext/ext_skel(自動為我們創建擴展的腳本)
./ext_skel --extname=test(創建名叫test的新擴展)
cd test
修改config.m4
這兩行比較重要
dnl [ ?--with-test ? ? ? ? ? ? Include test support])
dnl [ ?--enable-test ? ? ? ? ? Enable test support])
變成
PHP_ARG_WITH(test, for test support,
[ ?--with-test ? ? ? ? ? ? Include test support])
表示啟用了這擴展
phpize(可能出現這個命令不可用,先執行yum install php-devel)
執行完生成一些文件其中有個configure
./configure (執行這個shell腳本)
執行完產生Makefile
執行make
hello.c
static function_entry hello_functions[]
改為
static zend_function_entry hello_functions[]
編譯通過了,不知道為啥
總結
以上是生活随笔為你收集整理的PHP 拓展 开发,开发php扩展的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 买车需要注意什么?
- 下一篇: 动态规划算法php,php算法学习之动态