Php

在雪豹中安裝 PHP OAuth 擴展

  • December 8, 2016

我正在嘗試在 Snow Leopard 中安裝 PHP OAuth 擴展,我正在使用 Apple 捆綁的 Apache Web 伺服器和 PHP 5.3.2,它工作得很好。

當我輸入終端時:

sudo pecl install oauth

oauth-1.0.0.tgz 下載正常,但隨後出現此錯誤:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update  
downloading oauth-1.0.0.tgz ...  
Starting to download oauth-1.0.0.tgz (42,834 bytes)  
............done: 42,834 bytes  
6 source files, building  
running: phpize  
grep: /usr/include/php/main/php.h: No such file or directory  
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory  
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory  
Configuring for:  
PHP Api Version:  
Zend Module Api No:  
Zend Extension Api No:  
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

ERROR: `phpize' failed

我真的不知道這是什麼方法或如何解決它,請幫忙!

提醒自己:

  1. 安裝所有 Xcode
  2. 下載 PHP 原始碼
  3. source-dir./etc/
  4. 複製/pcre/目錄。進入:/usr/include/php/ext/
  5. pcre.h從in複製/usr/include/php/ext/pcrelib/到:/usr/include/php/ext/
  6. sudo pecl install oauth
  7. 添加extension=oauth.sophp.ini

您也可以使用Homebrew使用 Pear 安裝 PHP :

brew install php70 --with-pear [--with-apache]

然後安裝oauth:

sudo pecl install oauth

它會自動添加extension=oauth.sophp.ini.

引用自:https://serverfault.com/questions/192060