7

I've been trying to configure this for quite some time now but I can't get it running properly. Done so far:

  • Downloaded the latest version of xampp and moved it to /opt/lampp
  • Installed php5-xdebug with apt-get
  • Changed implicit_flush to On in /opt/lampp/etc/php.ini
  • Added the following lines to the end of the ini file:

    [xdebug]
    zend_extension="/usr/lib/php5/20090626/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_handler="dbgp"
    xdebug.remote_port=9000
    xdebug.remote_host="localhost"
    

I've made sure to restart apache, but I still don't get an xdebug-section when showing phpinfo();

I think that Eclipse is configured properly, but I can't know for sure until I get xdebug to run.

Please help, all suggestions are very welcome!

Edit:

Here is the output of phpinfo(): http://www.pasteall.org/35930

Update:

I've downloaded Xampp 1.8.1 (I had previously xampp 1.8.0) to /opt/lampp and added the appropriate development files. I have both compiled Xdebug myself according to the guide at http://xdebug.org/wizard.php and installed xdebug through /opt/lampp/bin/pecl.

Now my php.ini looks like this:

zend_extension = "/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_host = "localhost"
xdebug.remote_handler = "dbgp"

I don't know what to do, http://xdebug.org/wizard.php still reports that Xdebug isn't installed. Could it be a permission issue? Currently the permissions for the extensions are as follows:

-rwxr-xr-x 1 niklas niklas  88376 Sep 30 10:43 interbase.so
-rwxr-xr-x 1 niklas niklas 184920 Sep 30 10:43 oci8.so
-rwxr-xr-x 1 niklas niklas 118592 Sep 30 10:43 pgsql.so
-rwxr-xr-x 1 niklas niklas 830886 Oct 10 15:10 xdebug.so

Should they be owned by someone else? Must I enable any additional options in php.ini? This is my current output of phpinfo(): http://www.pasteall.org/36135

Niklas
  • 465
  • 2
  • 9
  • 19
  • Can you paste your full output from `phpinfo` somewhere – Petah Oct 05 '12 at 01:18
  • I've linked the full output in the "edit"-section of the question. Thanks for taking a shot at this! – Niklas Oct 05 '12 at 09:32
  • Can you not just use `apt-get` to install what you need rather than using xampp? – Petah Oct 10 '12 at 20:26
  • I prefer the ease of use of working with xampp when I'm in a development environment - like being able to utilize the built in GUI-control panel. From what I've gathered the issues I'm experiencing when setting up xdebug with xampp isn't the norm. – Niklas Oct 10 '12 at 22:56
  • I have always used xampp on windows, and its been fine. But for linux I used `apt-get`, sorry I can't be of more help. – Petah Oct 11 '12 at 03:19
  • did you restart Apache after changing php configuration? – Artjom Kurapov Oct 11 '12 at 13:37
  • Yep, I decided to just go with a regular lampp-installation instead and disable auto-starting if the services. – Niklas Oct 11 '12 at 17:11

4 Answers4

1

Tailored Installation Instructions

Summary

  • Xdebug installed: no
  • Server API: Apache 2.0 Handler
  • Windows: no
  • Zend Server: no
  • PHP Version: 5.4.4
  • Zend API nr: 220100525
  • PHP API nr: 20100525
  • Debug Build: no
  • Thread Safe Build: no
  • Configuration File Path: /opt/lampp/etc
  • Configuration File: /opt/lampp/etc/php.ini
  • Extensions directory: /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525
  • Instructions

    1. Download xdebug-2.2.1.tgz
    2. Unpack the downloaded file with tar -xvzf xdebug-2.2.1.tgz
    3. Run: cd xdebug-2.2.1
    4. Run: phpize

      As part of its output it should show:

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

      If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

    5. Run: ./configure
    6. Run: make
    7. Run: cp modules/xdebug.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525
    8. Edit /opt/lampp/etc/php.ini and add the line
      zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so
    9. Restart the webserver

    http://xdebug.org/wizard.php

    Petah
    • 45,477
    • 28
    • 157
    • 213
    • I've followed the guide but the wizard over at http://xdebug.org/wizard.php still says that it isn't installed :/ – Niklas Oct 10 '12 at 13:05
    • Please take a look at the update to my question to see if you know what the problem is :) – Niklas Oct 10 '12 at 13:23
    • Have you tried telling configure where your lamp is as per http://stackoverflow.com/questions/2168411/installing-xdebug-for-php-on-ubuntu-with-xampp `./configure --enable-xdebug --with-php-config=/opt/lampp/bin/php-config` Though it really is trivial to set up a LAMP stack on Ubuntu with `tasksel`: http://www.unixmen.com/install-lamp-with-1-command-in-ubuntu-1010-maverick-meerkat/ – George Oct 11 '12 at 09:31
    1

    See below URL i think it is very help full to you

    http://www.edmondscommerce.co.uk/ubuntu/ubuntu-xampp-xdebug-install/

    http://www.webhelp2u.com/article/install-xdebug-on-lampp

    https://stackoverflow.com/questions/9640912/problems-setting-up-eclipse-with-xdebug

    Read it:-

    Install XDebug on ( LAMPP OR XAMPP For Linux )

    http://www.edmondscommerce.co.uk/ubuntu/ubuntu-xampp-xdebug-install/

    http://www.webhelp2u.com/article/install-xdebug-on-lampp

    To Install XDebug on LAMPP

    1. Download the latest version of ( XAMPP For Linux ) From site http://www.apachefriends.org/en/xampp-linux.html

    2. Install it. To install lampp, extract and put in /opt directory.

    3. Download Development package from same site.

    4. Extract it, copy and paste "include" folder from Development package to /opt/lampp directory. ( This package would use for compiling XDebug source )

    5. Run command /opt/lampp/bin/pecl update-channels. this would update the pecl channels database at your local pc.

    6. Run command /opt/lampp/bin/pecl install Xdebug. And wait for finishing the process.

    7. Now xdebug.so file has been created in /opt/lampp/lib/php/extensions/ directory.

    8. Now Open the file php.ini and add the line zend_extension="/opt/lampp/lib/php/extensions/path_to_xdebug.so". at the end of file.

    9. Restart Lampp & Check enabled or not using phpinfo();

    Update my answer after your comment

    See below URL i think it is very help full to you.

    Setup Xdebug for PHP5 in Ubuntu

    http://gayanhewa.info/setup-xdebug-php5-ubuntu/

    Community
    • 1
    • 1
    Abid Hussain
    • 7,724
    • 3
    • 35
    • 53
    • I've followed the guide but the wizard over at http://xdebug.org/wizard.php still says that it isn't installed :/ – Niklas Oct 10 '12 at 13:06
    • Please take a look at the update to my question to see if you know what the problem is :) – Niklas Oct 10 '12 at 13:20
    • See below url i think it is very help full to you. http://www.edmondscommerce.co.uk/ubuntu/ubuntu-xampp-xdebug-install/ – Abid Hussain Oct 10 '12 at 14:04
    • I've already read the pages you've linked in your answer, they describe the exact same procedure as you did and it doesn't work. Refer to the "Update"-section of my question to see what I've attempted to fix the issue. – Niklas Oct 10 '12 at 15:22
    • Are you kidding me? You have just copied the answer from another question which is totally irrelevant to my issue! – Niklas Oct 11 '12 at 15:08
    1

    Since there is no sign of why it isn't working I've given up on xampp and just installed a regular lamp-server with xdebug through apt-get. I disabled mysql and apache2 from starting during boot so that they are not running if I don't want them. Here is a very simple tutorial on how to enable xdebug-debugging with Eclipse: http://www.web-brainz.co.uk/Xdebug

    The other answers will surely be the most fitting for other users though they unfortunately didn't fix my issue. Thank you very much for help!

    Niklas
    • 465
    • 2
    • 9
    • 19
    0
    • On a fresh ubuntu 12.04 run:

    apt-get install php5-xdebug

    • Check for xdebug if it is installed:

    php --version

    it looks like this:

    root@ubuntu-SandBox:/var/www# php --version PHP 5.3.10-1ubuntu3.19 with Suhosin-Patch (cli) (built: Jul 2 2015 15:05:04) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans root@ubuntu-SandBox:/var/www#

    • Modify your php.ini to load Xdebug run:

    vi /etc/php5/apache2/php.ini

    and add at the bottom of the file:

    [xdebug]

    xdebug.remote_enable=1

    xdebug.remote_handler="dbgp"

    xdebug.remote_port=9000

    /* this is the ip address of your PHPstorm IDE machine. */

    xdebug.remote_host="10.70.111.11"

    • Restart your server:

    service apache2 restart

    • Now your server is ready for your client IDE machine to connect.

    • Here is how to configure PHPSTORM:

    Follow this instruction of JetBrain https://confluence.jetbrains.com/display/PhpStorm/Validating+Your+Debugging+Configuration

    or

    On menu Run => Web Server Debug Validation and you will see something like this:

    enter image description here

    • If you dont get the yellow and everything is blue you are good!
    • Install chrome extension xdebug helper from here:

    https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en

    • Start a debug session in browser by enable this extension by click on it and the bug icon turns green.

    • Then in IDE Run => Listening for php debug connections.

    • Set a breakpoint in the source code

    • Load your php page (webapp) and it will be stopped at breakpoints.

    Done.

    Dung
    • 19,199
    • 9
    • 59
    • 54