0

I want to install a debugger for PHP for my MAMP environment on Mac OS 10.8.5, where I run PHP 5.5.3. I am looking at PHPStorm and Xdebug. I am doing my best to follow the instructions on the PHPStorm site.

Here are my steps:

1) Download the Xdebug extension compatible with your PHP version

$ su admin
$ cd /Applications/MAMP/bin/php/
$ git clone git://github.com/xdebug/xdebug.git

I understand that this installs Xdebug 2.3.2 (Release date: 2015-03-22)

2) Copy the extension file to your web server in a location that is accessible by the web server. I do not understand what this extension file is, so I have been unable to complete this step.

3) Add the following lines at the end of your php.ini file:

[Xdebug]

zend_extension="/Applications/MAMP/bin/php/xdebug/php_xdebug.h"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port="9000"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/Applications/MAMP/tmp"

Note the additional final line, suggested by this page.

4) Restart your web server

5) Check your installation

$ php --version
PHP 5.3.28 (cli) (built: Jan 23 2014 18:02:48) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

Not the right version of PHP. Trying again:

$ /Applications/MAMP/bin/php/php5.5.3/bin/php --version
PHP 5.5.3 (cli) (built: Sep 18 2013 14:31:13) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies

There is no sign of "With Xdebug..."

What exactly should I do at step 2? Have I made a mistake at any of the other steps? Are there further steps that I am missing?

James Newton
  • 6,623
  • 8
  • 49
  • 113
  • You are doing this wrong -- in your step #1 you are basically downloading **source code of xdebug** .. and you are not compiling it into binary/executable format but attempting to use it directly (i.e. `zend_extension="/Applications/MAMP/bin/php/xdebug/php_xdebug.h"`). This is wrong. – LazyOne May 11 '15 at 14:20
  • *"I do not understand what this extension file is"* It is a compiled xdebug file (should be named `xdebug.so` or similarly (sorry, not a Mac user here)). – LazyOne May 11 '15 at 14:21
  • So I have the source code, and I need to compile it. What are the steps I need to do that? – James Newton May 11 '15 at 14:21
  • Since you are using MAMP -- have a look at this user created manual: http://devnet.jetbrains.net/thread/436626 – LazyOne May 11 '15 at 14:21
  • Should not your MAMP come with xdebug already pre-installed? Accordingly to another [SO question](http://stackoverflow.com/q/11618178/783119) "Since 3.0.? version in PHP Tab you can see: Debugger - Activate XDebug" – LazyOne May 11 '15 at 14:26
  • Also: **Official manual:** https://confluence.jetbrains.com/display/PhpStorm/Installing+and+Configuring+MAMP+with+PhpStorm+IDE – LazyOne May 11 '15 at 14:27

0 Answers0