Xdebug not listed in phpinfo() - php

Useful informations:
Ubuntu 19.04 x86_64
PHP 7.2
Xampp for linux 7.3.4
Netbeans 8.2
Xdebug 2.7.1
I installed with success PHP-cli, netbeans and xampp for linux on my brand new Ubuntu 19.04 installation.
After that I uploaded my /opt/lampp/etc/php.ini file on https://xdebug.org/wizard.php and I followed scrupulously the instructions.
I copied the generated xdebug.so in /opt/lampp/lib/php/extensions/no-debug-non-zts-20180731 and then I edited the /opt/lampp/etc/php.ini adding those lines:
[xdebug]
zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9000
I went to http://localhost/dashboard/phpinfo.php , here I can see the Zend Engine logo but in the "configuration" section there isn't any xdebug section.
In my local terminal i executed those commands php -m and php -v. The first returned a list of modules among which xdebug was not included, the second returned a the php version and, again, xdebug was not included.
After this I decided to add the [xdebug] section also in the /etc/php/7.2/cli/php.ini and then the php -m and php -v commands have returned xdebug in loaded modules and in the version list.
Anyway the http://localhost/dashboard/phpinfo.php refuses to list xdebug among the active modules and if I try to start a debug session netbeans hangs-on "waiting for connection xdebug".
I checked two, three, four.... times the zend_extension path and is corrected
I restarted multiple times lampp, apache, netbeans and the pc
I tried multiple ports 9000, 9001, 9002 ....
The php and xdebug versions are compatible
Here are some similar problems: xdebug in phpinfo() is not showing , No xdebug in phpinfo() , Xdebug installed but does not display in Phpinfo for Xampp .
Obviously, when I could, I tried these solutions, but without success.

Related

xdebug gives Fatal error: Class not found

I've setup the xdebug, and I think I have installed it correctly. When I run php -v in terminal, it showed up my "with xDebug v2.6.1". Looking at the phpinfo(), it does show the xdebug extension. Running php -m on terminal does show the Xdebug under the [Zend Modules].
Now I'm trying to set it up for VS Code. I have the extension PHP Debug installed, Chrome extension xdebug installed.
The problem now is when I F5 from VS Code, it will give me fatal error : Class 'ParentClass' not found.
I'm running PHP v7.0.30 for Windows 10, with the server being IIS.
My php.ini:
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_port = 9000
xdebug.autostart = 1
xdebug.remote_log = "C:\Program Files (x86)\IIS Express\PHP\v7.0\tmp\xdebug.log"
zend_extension = "C:\Program Files (x86)\IIS Express\PHP\v7.0\ext\php_xdebug-2.6.1-7.0-vc14-nts.dll"
Any idea?

Use Xdebug with PhpStorm and WSL

I use WSL (Ubuntu 16.14) from Windows 10 as a web server with PHP 7.1 fpm and Apache.
I want to use Xdebug from PhpStorm 2018 with WSL but it's not working well.
Xdebug is installed on my Ubuntu server and it works well, I see it on phpinfo() output.
Here the php.ini config for Xdebug:
[Xdebug]
zend_extension="/usr/lib/php/20170718/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back=On
xdebug.remote_host=127.0.0.1
xdebug.remote_port = 9001
xdebug.idekey = PHPSTORM
I configured the port in php storm as 9001 too.
The problem is more on the connection between PhpStorm and WSL. I try it with the remote way. In the Run > Edit config popup, I use PHP Web Page and when I use the Validate tools, all is OK except the remote host.
I set it to 127.0.0.1 and this is the point.
When I listen the debugging tools, it said : Port 9001 is busy
How can I do a link between localhost and localhost ?
I am using WSL (Ubuntu 20.04 LTS) from Windows 10 as a web server with PHP 7.4 fpm and Apache with Xdebug Version 3.0.4
Following are the steps followed to configure the Xdebugger in the PHPSTORM and it works for me :
Install the Xdebug
select wsl in cli interpretor
To get the client_host run the ifconfig in ubuntu or ipconfig in bash
Open the below file
sudo vi /etc/php/7.4/cli/conf.d/20-xdebug.ini
add below in the above file
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.client_host=[ip4 address/Client_host]
xdebug.remote_connect_back=On
xdebug.client_port="9003"
xdebug.remote_handler=dbgp
xdebug.start_with_request=yes
xdebug.remote_log=/tmp/xdebug.log
Then use the Xdebugger chrome extension (xdebugger helper)
Restart the apache server.
Add the breakpoint to the file and refresh the page

Xdebug installed but does not display in Phpinfo for Xampp

I have the latest Xampp and Php 5.3 on Mac Mountain Lion oSX 10.8.2. I just installed Xdebug and configured it in the php.ini. I downloaded from this link and followed the instructions. Also put the following entries in php.ini
[Xdebug]
zend_extension=”/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/xdebug.so”
xdebug.remote_port = 9000
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "/Applications/XAMPP/xamppfiles/temp"
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_enable = On
xdebug.trace_output_dir = "/Applications/XAMPP/xamppfiles/temp"
Php -m displays the Xdebug modules but the phpinfo() does not show Xdebug. Read the solutions to questions Why is xdebug not showing up in phpinfo() and No xdebug in phpinfo() and it does not work for me. Note: I have restarted my Apache from Xampp Control multiple times.
Suggestions on
Any ways to rectify this?
Would Xdebug still work for me on my Eclipse Studio?
How can I provide permission to httpd to access Xdebug on Moutain Lion?
Thanks.
Make sure that the zend_extension path actually exists your your machine.
Your particular path seems like it is not valid.
zend_extension=”/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/xdebug.so”
I made the mistake of copying and pasting the path from some tutorial, but mine was actually located on this path:
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
Also, make sure that you are editing /Applications//XAMPP/xamppfiles/etc/php.ini, which is the php.ini associated with XAMPP. Which can easily be confused with /etc/php.ini which may be present on your machine.
Here is what I added to my php.ini for reference:
[xdebug]
zend_extension="/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-2012121/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
So this was more of a port issue on Mountain Lion. By default 9000 is assigned by Mac for firewall stuff and it kept assigning various ports for one or the other thing. I utilized Network Utility Port Scan on Mac to check for available ports. Also running the php script described below may give some debugging info as provided here
The detailed Configuring Eclipse part from this Stack Overflow Question helped the most.

Xdebug with nginx failed to load extension

I installed php 5.4.0 and nginx 1.0.14 on windows 7.
When i want to install xdebug i downloaded xdebug 2.20(new for 5.4.0) and then i copied dll into my "php ext" folder.After that i added these lines in php.ini file.
zend_extension = C:\nginx\php\ext\php_xdebug.dll
[xdebug]
xdebug.remote_enable = 1
xdebug.remote_autostart=off
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9900
but when i started nginx it seems "Failed loading C:\nginx\php\ext\php_xdebug.dll" but the folder and file is correct.
But when i tried to change "zend_extension = C:\nginx\php\ext\php_xdebug.dll" with "zend_extension_ts = C:\nginx\php\ext\php_xdebug.dll" it didnt seem any error but my phpinfo() file doesnt seem xdebug installed.
How can i run it ?
You should no longer use zend_extension_ts, but just zend_extension. The _ts and _debug postfixes have been removed in PHP 5.3. If you see "failed loading" it's most likely that you use the wrong binary. Please refer to http://xdebug.org/find-binary.php to see which one you need.

Why is xdebug not showing up in phpinfo()

I am trying to get the following to setup work:
Windows 7 - 64-bit
XAMPP 1.7.4
XDebug [php_xdebug-2.1.0-5.3-vc9-x86_64.dll]
When I run phpinfo() from Xampps homepage, XDebug it is not listed anywhere. I checked the Apache error logs and there are no errors, so it seems to load the module without problem? I haven't used PHP in years so I have no clue why this isn't working.
[PHP.ini]
[XDebug]
zend_extension_ts = "C:\xampp\php\ext\php_xdebug-2.1.0-5.3-vc9-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000
I think you don't have the right compiler version. Copy the output of your phpinfo onto this page and it will tell you which version you need.
Print out your
phpinfo();
and look at "Compilater" line
At home (win7x64 + wamp) => MSVC6 (Visual C++ 6.0)
So you need the vc6 version not vc9 version

Categories