4

I am using xampp5.6.15 on OS 10.11. I was following this instruction to install xDebug. My "tailored installation instruction" is as follows: enter image description here

In this instruction, it doesn't mention where to put the downloaded tgz file, so I just left it where it was in the downloads folder, after I ran phpize, the output is like this:

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:
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

I guess it is because the xdebug folder is not in the right place, I've tried moving it to xamppfiles/ and xamppfiles/modules/ and some other places but none of the works.

So what is wrong? Where should I place the folder?

shenkwen
  • 3,536
  • 5
  • 45
  • 85
  • What does `ls /usr/include/php/main/` show you? The files it's complaining about should be installed as part of your system; they're not source files but header files. However, they're not going to work unless you're using the same version of PHP. – miken32 May 19 '16 at 21:03
  • Really what you want to be doing is installing a package management system like Macports or Homebrew. They take care of all this nonsense for you, and keep things up to date as well. – miken32 May 19 '16 at 21:04
  • And no, where you have the files has nothing to do with it! – miken32 May 19 '16 at 21:12
  • 1
    Hi! I'm not sure if this comment is going to help you, but, if you're trying to install xDebug extension, basically the steps are: 1: Download the xdebug.so file for your php version. 2: Place the xdebug.so file in your extensions folder. 3: Change a configuration in your php.ini file, something regarding to zend extensions. In your case you must figure out where's your php.ini file, where is its extensions folder and what is your php version. Remember that you can have a php.ini for cli and another for apache, to avoid confusions, run the function phpinfo(); in a php file, not via console – Polak May 21 '16 at 23:24
  • 1
    And by the way, if your issues are due to the folder where you are placing the folder, I guess the folder should be within the application folder xampp, but they can be anywhere, because you are setting the extension path in your php.ini file... – Polak May 21 '16 at 23:31
  • I appreciate both responses, looks like the OP has gone quiet. I will try @Polak's method first as its the easiest. I don't remember seeing pre-built binaries for PHP 7.0.4 Mac. But I will check again. – Rajavanya Subramaniyan May 22 '16 at 12:00
  • @miken32 I did recently update PHP on my Mac from 5.5.6 to 7.0.4, but not using a package manager. but using http://php-osx.liip.ch/ – Rajavanya Subramaniyan May 22 '16 at 12:01
  • @Quakeboy so you've currently got three versions of PHP installed? Why? Doesn't change that you should have header files for the original, but that link specifically says it comes with xdebug so what's the problem‽ – miken32 May 22 '16 at 14:40
  • @miken32 sorry for not being clear earlier. I am not the person who asked the OQ. But I am on XAMPP on Mac 10.11 but with 7.0.4 bundled in XAMPP and I have the exact same problem. And 5.x was on my machine. Later I upgraded to 7.0.4 to match the XAMPP version. Wow I didn't notice Xdebug was included, now I need to find the so, move it to the xampp extensions folder and link them in the config file. – Rajavanya Subramaniyan May 23 '16 at 06:43
  • 1
    That's why I decided to use vagrant for developing on php in OS X...It doesn't seem to be a good idea at the beginning but then you realize that this kind of issues are easier to solve. There is another software called MAMP, it's the same thing as XAMPP I guess...maybe is a better choice...just check it... – Polak May 24 '16 at 16:43
  • @Polak that worked. If you post as an answer I would gladly upvote it. – Rajavanya Subramaniyan May 30 '16 at 09:44

4 Answers4

5

In xdebug source directory provide full path to XAMPP php binaries:

$ cd xdebug-2.5.0
$ /Applications/XAMPP/xamppfiles/bin/phpize
$ ./configure --enable-xdebug --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config
$ make

Next place modules\xdebug.so to Extensions directory (see tailored installation instructions).

technopriest
  • 161
  • 2
  • 5
1

Maybe you can solve the problem like:

1.cd xdebug-2.5.4
2./Applications/XAMPP/xamppfiles/bin/phpize

If you do not have home-brew please install it:https://brew.sh/

3.brew install autoconf
4../configure --enable-xdebug --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config

Don't forget to run 'make test':
5.make
6.make test
7.cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012

Edit /Applications/XAMPP/xamppfiles/etc/php.ini:
8.vi /Applications/XAMPP/xamppfiles/etc/php.ini
9.And add the line:
zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so

10.Restart your webserver.

My hope that this approach be helpful to you.

1

I just was struggling with the same problem and got the below message when I tried to run phpize to install xdebug. The solution (and problem) in my case was that I just had not installed the XAMPP developer files! When you run the XAMPP installer, you can check or uncheck this option. If you did not originally check it, just run the installer again, it allows you to just add the developer files.

And just to be complete: I also had an issue with the wrong version of php / phpize (the older OSX version was used), so I also had to set the path to the XAMPP versions of php, phpize etc. are stored:

export PATH=/Applications/XAMPP/xamppfiles/bin/:$PATH

Afterwards, everything was fine, and I could just follow the steps the XDEBUG wizard gave me: https://xdebug.org/wizard.php

This was the original error message I got by runnin phpize:

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

Patrick
  • 1,717
  • 7
  • 21
  • 28
makkabi
  • 619
  • 6
  • 10
  • This was exactly my problem. Nothing fancy, just running OSX Mojave and use XAMPP. Well, I also use Oh My ZSH. The only thing missing was re-running the SAME xampp installer and ensuring just the developer files were checked. It doesn't mess with anything else, just adds the dev files (source code). -- Once you have that installed, follow the install instructions from the xdebug wizard and your off :) – Wade Jun 05 '19 at 22:03
0

I think you are missing two things :

  • PHP Sources

I don't know XAMPP so I can't help here. Maybe the PHP sources are packaged with XAMPP, have a look.

  • autoconf

Try to install autoconf with

brew install autoconf
noli
  • 3,535
  • 3
  • 18
  • 20
  • There are no sources with XAMPP. But your answer does give me a hint. I could update my Mac PHP version (5.x) to match XAMPP's version (7.x) Then I could phpize it using my mac's PHP installation. Finally use the compiled .so along with XAMPP. – Rajavanya Subramaniyan May 17 '16 at 09:09