XDebug | make all app | Mobile Application library
kandi X-RAY | XDebug Summary
kandi X-RAY | XDebug Summary
make all app on your phone debuggable, forget about android:debuggable="true" or BuildConfig.DEBUG.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Hook hook
XDebug Key Features
XDebug Examples and Code Snippets
Community Discussions
Trending Discussions on XDebug
QUESTION
I have defined a Policy named UserPolicy
which goes like this:
ANSWER
Answered 2021-Jun-12 at 06:58You can not return anything except boolean
in Policy
class.You should return false
or true
.
Moreover when you use Gate
inside the policy
class you repeat the check policy
class again and this causes an infinite loop.
So this is the right way:
QUESTION
I'm using PhpStorm 2021.1.3 as an IDE with XAMPP as a PHP7.4 engine. I have installed Xdebug 2.9.2, and it works properly since I can start the debugger on specific PHP scripts.
My issue is that I have an HTML form in a PHP webpage (let's call it "mainpage.php", which sends its data to another PHP file (let's call it "analyze.php").
The issue is that if I start the debugger on that other PHP file ("analyze.php"), it doesn't get the GET/POST data, since I didn't use the form at all. Is there a way to pass the GET/POST data when launching the debugger?
I've looked into the run configurations, but they only seem to mention PHP options, and not GET/POST data.
I tried using the HTTP Request, but the only examples I've seen use actual web hosts and production environments, as far as I could tell. I only have this XAMPP development environment at the moment. My PHP files are not in the www folder of XAMPP, since PhpStorm seemed to have no problem so far copying the file at the right place when needed.
Any idea where I should look for?
...ANSWER
Answered 2021-Jun-10 at 15:04Ok, thanks to @waterloomatt I managed to find a workaround. The crux of the issue in my case is this PhpStorm bug: https://youtrack.jetbrains.com/issue/WI-54542 Therefore, this answer will probably be irrelevant once this bug is resolved.
Here's the solution on Linux :
Step 1 : Create a server on PhpStorm.In File->Settings->PHP->Servers, click on the "+" symbol to add a new server. Fill the server infos. The port is 63342, which is the port PhpStorm uses for running the code. Note that I gave this server the name "localhost63342". This detail is important.
Step 2 : Launch XAMPP normally.Launch XAMPP as you do normally. The issue is with PhpStorm, not XAMPP.
Step 3 : Before launching PhpStorm, add an environment variableOpen a command prompt, and run the following command:
export PHP_IDE_CONFIG=serverName=localhost63342
Note the server name, which is the same as the name of the server we defined in PhpStorm.
I could make that environment variable more permanent, but since it is a soon-to-be-resolved PhpStorm bug, I think that'll do.
Step 4 : In the same command prompt, launch PhpStormWe defined an environment variable, which is valid as long as the command prompt remains open. We then can launch PhpStorm with this command prompt. In my case, with the following command:
./$HOME/phpstorm/PhpStorm-203.7148.74/bin/phpstorm.sh
My Chrome browser already has the "Xdebug helper" extension: https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en That extension is already configured to use the PHPSTORM IDE Key, as shown here:
In PhpStorm, I put a breakpoint where I want in my code. I click the button to make PhpStorm listen for PHP Debug Connections. I then launch the code from the page I want using the launcher button (Chrome is Alt+F2 on my computer).
The code runs normally, and I can navigate from page to page. When, on a specific page, the code hits a PHP breakpoints, the code is suspended, and I can execute it line by line using PhpStorm's debugger. Since I filled the forms to get to this page, I get the GET/POST data.
It's not as direct as a PHP HTTP Request I suppose, but it works.
QUESTION
I build my crawler based on ChromeDriver Selenium
, and I want to measure the code coverage of the web application when my automated crawler crawls the application.
So, my question is how I do that using Xdebug (I'm newer on it). I installed Xdebug on my PHP, but I didn't know how to start? Can anyone have an idea to give me steps for that because I didn't find any resource that help me.
...ANSWER
Answered 2021-Jun-04 at 13:30I don't have a direct example, but I would approach this in the following way. The code is untested, and will likely require changes to work, take this as a starting point
In any case, you want to do the following things:
- Collect code coverage data for each request, and store that to a file
- Aggregate the code coverage data for each of these runs, and merge them
Collecting Code Coverage for Each Request
Traditionally code coverage is generated for unit tests, with PHPUnit. PHPUnit uses a separate library, PHP Code Coverage, to collect, merge and generate reports for the per-test collected coverage. You can use this library stand alone.
To collect the data, I would do composer require phpunit/php-code-coverage
and then create an auto_prepend file, with something like the following in it:
QUESTION
I have a setup with CentOS where xdebug 3 is installed.
As we are having problems with our umask for PHP processes with have in the php.ini added an umask.php file with auto_prepend_file
, when triggering XDEBUG this file is of course hit as first, but have no mapping locally.
I have looked into the option: XDEBUG_PATH_EXCLUDE
where I could add the path to the umask file, but here we have a chicken egg problem, because I cannot exclude it before it's already loaded.
Does an option exist to exclude it within the xdebug.ini file? I haven't found any indication that this option exists, but it doesn't mean that it's case.
...ANSWER
Answered 2021-May-31 at 09:43XDEBUG_PATH_EXCLUDE
is only used with xdebug_set_filter
, which can filter out files for code coverage or stack traces only, and not for debugging.
Even if you could add it in an ini file (you can't), it wouldn't do anything.
I would recommend that you find out how to solve your original problem, "As we are having problems with our umask for PHP processes...", instead of coming up with a "hack" to change the umask with an auto prepend file.
QUESTION
PHP Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so (dlopen(/usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so, 9): image not found), /usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so.so (dlopen(/usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so.so, 9): image not found)) in Unknown on line 0
Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so (dlopen(/usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so, 9): image not found), /usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so.so (dlopen(/usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so.so, 9): image not found)) in Unknown on line 0
Xdebug: [Config] The setting 'xdebug.remote_enable' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_enable (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_host' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_host (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_port' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_port (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
PHP 8.0.6 (cli) (built: May 13 2021 05:28:04) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.6, Copyright (c) Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
with Zend OPcache v8.0.6, Copyright (c), by Zend Technologies
...ANSWER
Answered 2021-May-27 at 08:23Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so (dlopen(/usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so, 9): image not found), /usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so.so (dlopen(/usr/local/Cellar/php/8.0.6_1/lib/php/20200930/xdebug.so.so, 9): image not found)) in Unknown on line 0
Indicates that you're trying to load Xdebug twice. One time successfully so that it shows up in php -m
, and one time with the wrong path, which gives this error. You need to find the wrong line in all of the ini files that are being loaded. You can find all the ini files that are being loaded with php --ini
.
QUESTION
I'm trying to diagnose why PhpStorm seems to lose its connection after a while to XDebug 3 running in a Docker container on Windows, so I have xdebug.log=/path/to/xdebug.log
in a .ini
file and I'm looking at that log file.
XDebug successfully does step debugging for both browser requests and CLI scripts, but it only writes to the log when CLI scripts are being executed. The log remains unchanged throughout step debugging if a browser request is being processed.
Why would CLI vs. browser make a difference to XDebug's logging? How can I enable it for browser requests?
...ANSWER
Answered 2021-May-27 at 08:19PHP on the CLI, and the PHP that runs through the web server might have different INI files. You can check which ones are used by using php --ini
on the CLI, or using phpinfo()
in a script that's run through the browser.
If they're using the same INI file, then check whether the value of xdebug.log
is correct. Using php -m xdebug | grep log
on the CLI, or again phpinfo()
in a script.
If these are both correct, then it could also be a permissions issue. If the /path/to/xdebug.log
has been created by the user that runs CLI commands (likely: you), then the webserver user will likely not have permissions to write to it too. You can check the owner and access rights of the log file with ls -l /path/to/xdebug
.
It is also possible that the webserver user does not even have access to the /path/to
part, which you can check with ls -l /path/to/
, and verify whether the webserver user is part of the access mask.
If this is your personal machine (and not anything shared, or in production), you can fix the permissions on /path/to/xdebug.log
with chmod 0666 /path/to/xdebug.log
which should give all users write access to that file.
QUESTION
Okay, this problem is driving me up a wall, I can't figure out why Prometheus won't serve metrics. I got to 192.168.2.13:8534/metrics but all I get is the spinner contacting the port. I go to "wget http://localhost:8055" locally inside the container and I get
"Connecting to localhost (localhost)|127.0.0.1|:8055... connected. HTTP request sent, awaiting response..."
Docker is pointing 8543 -> 8055
I call my app to start which is nothing more than a class with Main method. With the call below my class app starts and responds perfectly. I also open JVisualVM and JMX show all the JVM info and metrics perfectly. I can attach a debugger no problem.
...ANSWER
Answered 2021-May-25 at 10:48Turns out in the underlying code was calling an embedded Jetty server thus the actual pace where I needed the metrics from. Now to figure out how to get metrics from embedded jetty.
QUESTION
I am on Ubuntu 20.04 using php 7.4.18 and apache and has its document root at /var/www/html
. This is my php --version
ANSWER
Answered 2021-May-24 at 14:05You're setting Xdebug 2 settings, but running Xdebug 3:
QUESTION
Today I am faced with a bizarre situation. I have been searching for a definition but unfortunately, I couldn't find any.
In my PHP code, I am inserting a row into a database table. When I try to insert a duplicate primary key as part of debugging a recent issue, I can see the duplicate primary key exception in the mysqli
object as expected.
However, mysqli->$errno
, mysqli->$error
, mysqli->error_list
are immediately being reset to empty which I cannot comprehend why.
This is part of the code that I am experiencing the issue with.
...ANSWER
Answered 2021-May-22 at 10:25I'm sorry to say this but it looks like the problem is that you are using an unsupported PHP version. The broken mysqli::$stat
property was removed in PHP 7.4. The solution is to upgrade your PHP version.
When triggering any MySQLi function the error and error properties are reset. You have to check it immediately after calling each function.
For example:
QUESTION
Now I want to make a docker command run in frontend so that I could see the log output. Now I am using this command to run my docker container:
...ANSWER
Answered 2021-May-21 at 09:21Basically, you should get the point (based on your latest comment). Docker is based on some command, when it's done - it stops the container.
So to make it continuously running you should have command and run infinitely.
Also check this answer as well, there are more explanation Why docker exiting with code 0
One of the easiest solution is to tail some logs. Like,
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install XDebug
You can use XDebug like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the XDebug component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
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