2

I have installed xdebug from source in my system and add to my php.ini the following code at the end of the file:

/opt/lampp/etc/php.ini

[Xdebug]

zend_extension=”/usr/lib/php/20151012/xdebug.so”
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

I created a php file to see the state of the server:

phpinfo.php

<?php phpinfo(); ?>

After restart apache I have no information about xdebug running. I don't know what seems to be the error or what are missing.

I did: /opt/lampp/bin $ phpenmod xdebug And it created me a xdebug.ini in /etc/php/7.0/mods-available with

zend_extension=/usr/lib/php/20151012/xdebug.so

Instead of compiling over source xdebug I downloaded the working builds from ActiveState (the makers of the Komodo IDE) provide their pre-compiled binaries of xdebug they use in their IDE. Just go to their site: http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging The packages contain builds for all php versions. I copied xdebug.so to /opt/lampp/lib/php/extensions and changed my php.ini with the entry zend_extension=”zend_extension=/opt/lampp/lib/php/extensions/xdebug.so” I changed also xdebug.ini with zend_extension=/opt/lampp/lib/php/extensions/xdebug.so I restarted lampp and nothing seems to work for now.

When I run phpinfo.php with apache restarted I have no information about xdebug.

6
  • 1
    Just to make sure, have you checked to make sure that you xdebug.so is in the right place /usr/lib/php/20151012/xdebug.so? And when you run php -v in the command line, do you get the right version of php?
    – circlesix
    Jun 5, 2018 at 17:22
  • 1) first check /usr/lib/php/20151012/xdebug.so the file is available. 2) enable using this command php5enmod xdebug 3) run php -v to check xdebug display xdebug. Jun 5, 2018 at 17:28
  • Done Rama. My php -v gives me PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.30-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies with Xdebug v2.7.0alpha1, Copyright (c) 2002-2018, by Derick Rethans but when I start apache my phpinfo.php have no information about xdebug. I can't understand why.
    – Nuno Sousa
    Jun 6, 2018 at 4:06
  • can you provide php.ini file were you added the /usr/lib/php/20151012/xdebug.so. i will check and tell you :) Jun 6, 2018 at 5:06
  • can you please update question and remove from ans. ans is used to provide the ans. Jun 6, 2018 at 5:24

1 Answer 1

0

Configure Xdebug in Linux env(UBuntu) ::

  1. Need to run phpinfo() to check xdebug is enable or not.

    IF not enable , need to run sudo apt-get install php-xdebug Now, we have to restart our server to check xdebug is displaying after run
    phpinfo() function.

  2. we can expect that xdebug is showing after run phpinfo().

    Now, we have to make some configuration in php.ini file. try to add below piece of code at end of php.ini file


[XDebug]
xdebug.remote_enable=1
xdebug.remote_autostart = 1
xdebug.remote_port="9000"
xdebug.profiler_enable=1
xdebug.remote_host="localhost"

Again we have to restart server once

service apache2 restart //or /etc/init.d/apache2 restart

Hope, we are using VS code(visual studio code)

Just need to install php xdebug in this IDE. Reopen this IDE.

I think , everything will working fine. NP: From my side , I have configure this & works like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.