PHP模組編寫

來源:互聯網
上載者:User
開發PHP Module

1、首先進入PHP原始碼目錄中的ext目錄,執行如下命令:

# ./ext_skel --extname=自訂模組名

執行完成後,會產生以“自訂模組名”命名的檔案夾,進入這個檔案夾後編輯config.m4檔案

找到如下代碼:

dnl PHP_ARG_WITH(Test, for Test support,
dnl Make sure that the comment is aligned:
dnl [ --with-Test Include Test support])

dnl PHP_ARG_ENABLE(Test, whether to enable Test support,
dnl Make sure that the comment is aligned:
dnl [ --enable-Test Enable Test support])

去掉每行前面的dnl

2、編寫調用函數(參考之前三篇模組編寫的文章)

3、編譯:

  使用傳統的php模組編譯方法:

    phpize

    ./configure

    make

    make install

4、然後把模組extension進來,ok!可以使用自己的模組啦!這些是最基本的操作,接下來就看自己的C語言功底啦!

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.