簡體   English   中英

無法在OS X 10.9 Mavericks中進行phpize或配置擴展

[英]Can't phpize or configure an extension in OS X 10.9 Mavericks

我試圖在OS X 10.9 Mavericks上構建與內置PHP 5.4一起使用的memcached擴展,最初我嘗試使用pecl install memcached但這引發了以下問題。

checking for zlib location... configure: error: memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located
ERROR: `/private/tmp/pear/install/memcached/configure' failed

因此,我創建了一個tmp目錄,並執行pecl download memcached ,解壓縮了代碼,並將其CD到相應的目錄。

嘗試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:  

我之前已經brew安裝了zlib,並指向./configure進行安裝。 ./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8我收到以下錯誤消息:

checking for session includes... configure: error: Cannot find php_session.h

因此,現在我想知道這里的最佳操作方法... /usr/include/根本不存在...這是特立獨行的事情嗎? 我完全不記得10.8中有這個問題。

我可以嘗試brew安裝php-devel但是我認為那不是我需要的正確版本嗎? 任何幫助將不勝感激

更新資料

locate php_session.h顯示

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/php/ext/session/php_session.h

我應該將ln -s到期望的位置,還是可以通過XCode做到這一點? 我已經安裝了命令行工具...

運行xcode-select --install以安裝XCode5命令行工具,然后sudo pecl install memcache 你應該很好。

以afessler sugest的身份安裝XCode5命令行工具后(xcode-select --install),由於缺少pecl,我無法執行“ sudo pecl install memcache”。 我必須按照此指南安裝PEAR和PECL: http : //techtastico.com/post/como-instalar-pear-y-pecl-en-os-x-mavericks/ 然后一切都很好。 謝謝!

我遇到了這個問題,這是由於MAMP沒有所有PHP源代碼。

我發現這個非常有用的解決方案說明了如何下載和配置它們: https : //stackoverflow.com/a/11175197/369326

請注意,MAMP組件不包含任何高於php 5.4.10的PHP版本的附加功能,但是您可以從http://php.net/releases下載這些附加功能。

如上所述,但不使用xcode install嘗試手動安裝pecl:

  curl -O http://pear.php.net/go-pear.phar 
  sudo php -d detect_unicode=0 go-pear.phar 

然后:

 sudo pecl install memcache

詳情請見: http : //jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/#sthash.x2LKdqj6.dpuf

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM