xdebug | Xdebug — Step Debugger and Debugging Aid for PHP | Code Inspection library
kandi X-RAY | xdebug Summary
kandi X-RAY | xdebug Summary
Xdebug — Step Debugger and Debugging Aid for PHP
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse a line
- Returns functions .
- Parses the file .
- Add time to a function
xdebug Key Features
xdebug Examples and Code Snippets
Community Discussions
Trending Discussions on xdebug
QUESTION
On every page I have jQuery modal which contains a contact form and which on every page need sent data to different email address. When a form is submitted I need to display successful response using json_encode
. Also on every page I use page identifier as $pages_id=1
, $pages_id=2
, etc., for identify which form is submitted. However, very important, without jQuery file, complete my PHP code it's executed correctly, all data are successfully inserted into database and in Xdebug I also see that code on every line it's executed successfully. But, if I include jQuery file then in Xdebug the value for $pages_id
return null. I exactly think at this line of code:
ANSWER
Answered 2021-Dec-20 at 17:54page_id is null in your script because you dont set it in the script.
So why not just adding an hidden input field in your froms with the page id and then in your PHP code
$page_id = $_POST['pageId'];
i think you did not understood ajax correclty. if you post your data to /inc/FormProcess.php it is not like an include before, where you could create variables first and then include it. AJax is like a sub call to the script. it is like if you would open ONLY this scrirpt provided in URL. so at this point you dont have your variables.
you need to get the variables or send your ajax request NOT to /inc/FormProcess.php but to the script where you define the variable
QUESTION
I'm configuring Xdebug in VS Code and it doesn't work when I use the start_with_request=trigger
setting.
If I set the config value to yes
it works.
I think VS Code is not sending the env variables from the launch.json
file.
My Xdebug ini file:
...ANSWER
Answered 2022-Mar-31 at 16:16vscode-php-debug dev here.
This is a common misunderstanding. The provided launch.json
only listens for Xdebug/DBGp connections - as the default name implies. If there was also a program
setting in there, VS Code would also start a (php) process. And only in that case could VS Code contribute to the environment of that newly started process.
So, assuming you are running a web server, you can only change Xdebug settings by modifying the php.ini or somehow change the process environment of that web server process...
You can also check out other launch.json
snippers by typing php
at the end of the current snippet. Maybe some of them could be useful.
Perhaps I should add a warning if somebody sets env
without setting program
...
QUESTION
On a project I'm working on, xdebug takes approximately 1 hour to generate coverage. I've experimented with phpdbg
, but I encounter the following error in my test suite:
ANSWER
Answered 2022-Mar-31 at 13:27This warning can be triggered with the following PHP snippet:
QUESTION
I have installed Xdebug on a Ubuntu 20.04 system. I followed this documentation , which I found to be quite well written, and got everything installed per the specs. (I used apt rather than yum, and placed the .so file into /usr/lib/php/20190902
folder rather than the document's example.)
In that document, there is a reference to adding to the php.ini file (I added to /etc/php/7.4/apache2/php.ini
and /etc/php/7.4/cli/php.ini
files). Since the article doesn't specifically mention "sections" of the .ini file, I put them within the [PHP]
section. (This is consistent with the remark about putting right before the Quick Reference bit.) I restarted Apache2 and the phpinfo()
output now includes Xdebug, which it did not include before. All well and good.
The trouble I'm having is that although I set xdebug.mode = debug
in the php.ini files, the phpinfo()
output tells me that xdebug.mode
is set to develop
. Consequently, Step debugger shows as Disabled in my configuration. I cannot see why.
These are the lines I've added to each of those php.ini files:
...ANSWER
Answered 2022-Mar-22 at 00:04zend_extension="/usr/lib/php/20190902/xdebug.so
(that has an extra "
).
In any case, it is very likely that there is either another xdebug.mode
line somewhere, or a different INI file is being used. Try to see what the output of xdebug_info()
tells you — it also mentions which INI files have been read.
QUESTION
I ported a local development setup from Linux to a new Mac machine and am having problems with getting Xdebug to work with PhpStorm in a Mac M1 Pro machine.
I have one container with PHP where Xdebug is installed and configured like this:
...ANSWER
Answered 2022-Mar-15 at 16:42xdebug.discover_client_host=1
is most certainly not correct for use with Docker, you need to set that to 0. discover_client_host
uses the HTTP headers to see where the request came from, but as NAT gets involved with Docker Xdebug (and PHP) will see an IP address or host name it can not connect to.
Setting xdebug.client_host=host.docker.internal
should be correct with Docker, and this should be the network gateway address, which is what your host is too.
(Even if xdebug.discover_client_host=1
, as Xdebug will fall back to the xdebug.client_host
setting if it can't connect to the incorrect one it found with HTTP header discovery.)
If you want to see more detailed logs, also add xdebug.log_level=10
, which should give more insight.
You don't need "bind port" in docker-compose.yaml
for Xdebug, as Xdebug does make the connection to the IDE, and hence the port does not need to be exposed for receiving connections.
QUESTION
So first of all since October for some reason my previously working Xdebug config for VSCode + Docker stopped working.
I switched over to an Xdebug 3 config to try it out, since 2.9 appears to have stopped working for me. Maybe because of a VSCode or PHP Debug plugin update?
But so far I have been unable to get it working or get it working only half?
VSCode launch.json:
...ANSWER
Answered 2022-Jan-11 at 12:58If you are using vscode IDE, than check your port in launch.json file. keep it 9000 and restart your vscode.
you can copy launch.json file from here.
QUESTION
To access localhost from my local machine during the development of a Symfony web app.
My Environment- WSL2 running on Windows 10
- Linux, Apache2, MySQL, PHP-7.4 stack (with Xdebug3 intalled)
- Debian 10
- Symfony 5.4 (although not sure on if relevant to this problem)
- Set up WSL2 according to this Microsoft WSL2 tutorial
- Set up LAMP stack according to this Digital Ocean tutorial
- Set up Symfony according to this Symfony tutorial
- Run the following bash script on startup to start my services and set the host to the virtual WSL IP in my xdebug.ini file
ANSWER
Answered 2021-Nov-11 at 11:03Try to run command netstat -nltp
. It shows active addresses and ports. Your nginx process should be run at 0.0.0.0:8000. 0.0.0.0 means the nginx process is available from anywhere.
If your nginx process is ran by any specific ip address, you should access it by that ip address, e.g http://192.168.4.2:8000.
QUESTION
I have a problem with Xdebug on Mac OS using Big Sur. Below, I will explain what is happening.
- When I run
phpinfo()
- I don't see a Xdebug section at all. - When I run commands such as
xdebug_call_file()
it throws aPHP Fatal error: Uncaught Error: Call to undefined function
error.
Here are all the configurations:
php -v
:
PhpStorm shows that Debugger is active:
php.ini
(/usr/local/etc/php/8.0/php.ini) has these configurations:
ANSWER
Answered 2022-Jan-27 at 05:45
develop
: Enables Development Helpers including the overloaded var_dump(). https://xdebug.org/docs/all_settings#mode
xdebug.mode=debug,develop
QUESTION
I am working on a new project which embedded a tomcat with the dependency spring-boot-starter-tomcat:2.5.3 (into vaadin-spring-boot-starter). I am building my project into a .jar, and launching it with "mvn spring-boot:run".
But because of the embedded tomcat, I am unable to use the debug mode with Eclipse.
I have already try to launch a remote debug session, with :
...ANSWER
Answered 2021-Aug-20 at 09:04When running application using mvn spring-boot:run
you can attach debugger like this:
QUESTION
I've got a docker image running 8.0 and want to upgrade to 8.1. I have updated the image to run with PHP 8.1 and want to update the dependencies in it.
The new image derives from php:8.1.1-fpm-alpine3.15
I've updated the composer.json
and changed require.php
to ^8.1
but ran into the following message when running composer upgrade
:
ANSWER
Answered 2021-Dec-23 at 11:20Huh. This surprised me a bit.
composer is correctly reporting the PHP version it's using. The problem is that it's not using the "correct" PHP interpreter.
The issue arises because of how you are installing composer.
Apparently by doing apk add composer
another version of PHP gets installed (you can find it on /usr/bin/php8
, this is the one on version 8.0.14).
Instead of letting apk
install composer for you, you can do it manually. There is nothing much to install it in any case, no need to go through the package manager. Particularly since PHP has not been installed via the package manager on your base image.
I've just removed the line containing composer
from the apk add --update
command, and added this somewhere below:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xdebug
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page