FreeBSD下swoole的安裝

  1. 按照swoole官網的wiki,下載源碼php

  2. cd swooleshell

  3. phpizeswoole

    • 這一步的執行在經過PKG安裝PHP的FreeBSD上面會報錯this

      Configuring for:
      PHP Api Version:         20160303
      Zend Module Api No:      20160303
      Zend Extension Api No:   320160303
      Cannot find autoconf. Please check your autoconf installation and the
      $PHP_AUTOCONF environment variable. Then, rerun this script.
    • 解決方案 : pkg install autoconfcode

  4. ./configureip

  5. make源碼

    • 在FreeBSD上執行這一步操做會有以下報錯it

      In file included from /root/swoole/swoole.c:25:
      In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27:
      /usr/local/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found
    • 問題產生緣由: FreeBSD安裝的pcre的"pcre.h"不在swoole搜索的文件路徑io

    • 解決方案: ln -s /usr/local/include/pcre.h /usr/include/pcre.hclass

  6. `make install

  7. php.ini文件中添加extension=swoole.so

相關文章
相關標籤/搜索