Installing and enabling Xdebug on MAMP PRO

2019-03-30 16:43发布

问题:

I am trying to set up Xdebug on my MAMP PRO installation. I tried xdebug.org/wizard.php to get the correct Xdebug version with custom installation instructions but I got stuck.

According to step 4 in the tailored installation instructions I should get the following output:

Configuring for:
...
Zend Module Api No:      20100525
Zend Extension Api No:   220100525

But my output reads as follows:

Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

Next I try the instructions at xdebug.org/docs/faq#custom-phpize because the tailored installation instructions advice me to do so.

I undo the first step by deleting xdebug-2.2.1.tgz and the unpacked folder and then I start at step 1 again. My input for step 4 is

/Applications/MAMP/bin/php/php5.4.4/bin/phpize

and the output reads as follows:

grep: /Applications/MAMP/bin/php/php5.4.4/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.4.4/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.4.4/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:        
Zend Module Api No:     
Zend Extension Api No: 

My guess would be that I need to install php.h, zend_modules.h and zend_extensions.h but I can not find them on the web. How do I best proceed in order to install Xdebug?

Thanks.

回答1:

The creators of MAMP have not released the usual open source components package with the 2.1.1 release, so you'll have to do the following. php.h, zend_modules.h and zend_extensions.h can be found in the source code for PHP 5.4.4. Here's a link to the page with the source code: http://us2.php.net/get/php-5.4.4.tar.gz/from/a/mirror

You'll want to extract that, and the move the folder to /Applications/MAMP/bin/php/php5.4.4/include, creating the include directory if needed. I believe you'll need to run ./configure from within /Applications/MAMP/bin/php/php5.4.4/include/php as well to generate the Zend headers. Then, try the instructions you found again.



回答2:

Thanks it worked for me. You have to run

./configure

and

make

to generate the missing zend headers.



标签: php mamp xdebug