Having problems while try to install OAUTH with PECL in MAMP on mac OS lion

空扰寡人 提交于 2019-11-26 21:44:18
Stephen

I know this is old but I found this question while having a similar issue.

MAMP doesn’t ship with a bunch of the PHP sources

  • Download MAMP components and configure
  • URL: http://www.mamp.info/en/downloads/index.html (i.e. MAMP_components_2.0.2.zip)
  • Unpack your MAMP_components_2.0.2.zip
  • Identify your php-5.x.x.tar.gz file (where 5.x.x is your version of PHP)
  • If you are using php > 5.4.10 then download the sources from http://php.net/releases as they are not in the MAMP components download (credit pulkitsinghal in comments)
  • Create directory for your PHP sources:

    mkdir -vp /Applications/MAMP/bin/php5/include

  • Untar php-5.x.x.tar.gz into /Applications/MAMP/bin/php/php5.*/include or /Applications/MAMP/bin/php5/ include:

    tar zxvf php-5.x.x.tar.gz -C /Applications/MAMP/bin/php/php5.?.??/include

  • Rename your php-5.x.x directory to php (without the version numbering):

    mv /Applications/MAMP/bin/php/php5.2.17/include/php-5.?.?? /Applications/ MAMP/bin/php/php5.2.17/include/php

  • Configure PHP sources (it’ll create necessary files i.e. zend_config.h, tsrm_config.h, etc.):

    cd /Applications/MAMP/bin/php/php5.?.??/include/php

    ./configure

The process was for another fix but this resolved the issues with php.h not being found

Credit to where I found the answers - :

Thomas Hunter Blog

Google Doc detailing process

I had the same problem whilst trying to pecl install -f ssh2 with MAMP.

Here's how I fixed it:

  1. MAMP doesn't provide the source code archive for PHP 5.4.10 so download it from php.net
  2. Extract the source code archive to /Applications/MAMP/bin/php/php5.4.10/include/php
  3. Run ./configure to configure the source code for your platform (without this step the pecl install will fail looking for a bunch of header files)
  4. Retry your pecl install

(much thanks to Stephen's answer which is pretty much the same)

This is a complement to Stephen's answer and Greg's comment

When compiling xdebug 2.3.2 for php 5.6.2 on OSX 10.10.2, I could not get rid of the

'zend_config.h' file not found

error until I added the following option to ./configure in the php folder:

./configure --without-iconv

Credits to Cameron Browning

sonique

PECL Modules are compiled modules, in order to install them, you need the PHP headers. You can found the headers on php.net/downloads.php make sure you download a version which match with your PHP version. Then you can follow this : Installing PHP OAuth in MAMP environment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!