關於Mac安裝PHP相關擴充出現Zend/zend_config.h缺失的問題記錄

來源:互聯網
上載者:User

標籤:php   extension   redis   error   

Mac升級之後,系統內建的php版本也會隨之升級,我用的就是系統內建的版本


麻煩的是擴充在版本變更後需要重新編譯安裝

重新安裝redis  xdebug 等擴充時卻會遇到各種標頭檔缺失的問題


之前從php官網下載php源碼包解壓之後,放到提示缺失檔案的目錄中,就可以解決這個問題。

後來也有自己重新編譯覆蓋安裝過PHP,不過感覺都比較繁瑣,...


常見的錯誤提示如下(redis)

In file included from /usr/include/php/main/php.h:35:

/usr/include/php/Zend/zend.h:51:11: fatal error: ‘zend_config.h‘ file not found

# include <zend_config.h>

          ^

1 error generated.

make: *** [redis.lo] Error 1



網上搜尋之後,從各種參考資源中發現了這個,感覺可以試試


I finally managed to install xdebug. In fact, I had to install Xcode developer tool and then copy the files from/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/php into /Applications/MAMP/bin/php/php5.4.4/include and then it worked !


於是在Xcode對應的目錄看了看,確實有類似的目錄存在。

拷貝至相應的目錄後,編譯安裝通過。 僅以此備忘。


友情提示:   注意觀察錯誤提示, 參考的資料與自己的情況通常都有差距,舉一反三很重要 :)



本文出自 “微所欲為——微生活” 部落格,請務必保留此出處http://vsfor.blog.51cto.com/4165449/1892319

關於Mac安裝PHP相關擴充出現Zend/zend_config.h缺失的問題記錄

聯繫我們

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