linux編譯安裝php libevent擴充庫

來源:互聯網
上載者:User
linux編譯安裝php libevent擴充的方法,在php編程中實現高效能的網路服務,需要libevent擴充庫的支援,本文通過編譯源碼的方式安裝libevent擴充庫。

php編寫高效能網路服務,需要安裝libevent擴充。

1、下載libevent擴充: http://pecl.php.net/package/libevent

2、解壓後,開始編譯

$ cd libevent-version$ /usr/local/php/bin/phpize$ ./configure --with-php-config=/usr/local/php/bin/php-config

報錯,錯誤顯示為re2c版本過低。re2c,PHP的詞法解析器,官網:http://re2c.org/,下載最新的版本,編譯完成。繼續編譯剛才的PHP擴充,仍然報錯error: Cannot find libevent headers

直到這裡,肯定是沒找到libevent的目錄, 本地查看是否安裝了libevent, 終於在一個目錄下找到了libevent-2.0.12-stable目錄。 3、如果未安裝,則先需安裝libevent。

wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gztar zxvf libevent-2.0.20-stable.tar.gzcd libevent-2.0.20-stable/./configure --prefix=/usr/local/libevent-2.0.20-stable/makemake installcd ../

4、繼續編譯擴充

$ cd libevent-0.0.5$ /usr/local/php/bin/phpize$ ./configure --with-php-config=/usr/local/php/bin/php-config --with-libevent=/usr/local/libevent-2.0.20-stable$ make && make install

這次編譯通過了。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.