I'm trying to get Eclipse to talk to xdebug. From the xdebug log, it seems that xdebug is working correctly (i.e.: it's sending it's <init> and <response> messages), but Eclipse is not sending anything to xdebug (i.e.: no feature_set, feature_get, etc. commands like Netbeans).
Here's my setup:
Mac OS/X 10.7.5
Eclipse 4.2.1 "Juno"
PHP Development Tools (PDT) SDK Feature 3.1.1.201209101312
(Netbeans 7.1.2)
MAMP 2.1.1 running:
apache 2.2.22
PHP 5.4.4
the PHP executable being run is /Applications/MAMP/bin/php/php5.4.4/bin/php
the PHP config file being used is /Applications/MAMP/bin/php/php5.4.4/conf/php.ini
xdebug 2.2.0
The relevant lines from my php.ini are:
[xdebug]
zend_extension = "/Applications/MAMP/bin/php/php5.4.4/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.default_enable = on
xdebug.remote_enable = on
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_autostart = on
xdebug.remote_handler = "dbgp"
xdebug.remote_autostart = on
xdebug.remote_mode = "req"
xdebug.remote_connect_back = on
xdebug.remote_log = /tmp/xdebuglog.log
I can get Netbeans to connect to xdebug on port 9000 with session ID netbeans-xdebug with no problem. Note that when I start debugging, it opens a new window in my web browser with ?XDEBUG_SESSION_START=netbeans-xdebug appended to the URL of the PHP file I'm running.
Here is a snippet from the xdebug log when Netbeans tries to connect:
Log opened at 2013-01-18 18:42:52
I: Checking remote connect back address.
I: Remote address found, connecting to ::1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Applications/MAMP/htdocs/projectname/index.php" language="PHP" protocol_version="1.0" appid="647" idekey="netbeans-xdebug"><engine version="2.2.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]></copyright></init>
<- feature_set -i 0 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="0" feature="show_hidden" success="1"></response>
<- feature_set -i 1 -n max_depth -v 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1"></response>
<- feature_set -i 2 -n max_children -v 30
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response>
<- feature_get -i 3 -n max_data
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="3" feature_name="max_data" supported="1"><![CDATA[1024]]></response>
<- stdout -i 4 -c 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="4" success="1"></response>
<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="5" status="break" reason="ok"><xdebug:message filename="file:///Applications/MAMP/htdocs/projectname/index.php" lineno="17"></xdebug:message></response>
<- stack_get -i 6
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="6"><stack where="{main}" level="0" type="file" filename="file:///Applications/MAMP/htdocs/projectname/index.php" lineno="17"></stack></response>
…
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="14" status="stopping" reason="ok"></response>
Log closed at 2013-01-18 18:47:21
In Eclipse…
I created a new PHP Project in the workspace, using the default PHP settings, and created separate folders for source files and public resources. I changed nothing in the PHP Include Path step, but in the PHP Build Path, I clicked Link Source and linked /Applications/MAMP/htdocs/projectname with a projectname folder in my project.
I then set Eclipse preferences as follows:
In General -> Web Browser, I've set it to use an external web browser (Firefox).
In PHP -> Debug -> Installed Debuggers, I've checked that XDebug is in the list, is using port 9000, JIT remote sessions are off, and I used these instructions to ensure it uses the idekey mparker17.
In PHP -> Debug, I:
Set the PHP Debugger to "XDebug"
Set the PHP Server to the correct base URL (http://projectname.local) local web root (/Applications/MAMP/htdocs/projectname) and path mapping between the server and my workspace.
Set the PHP Executable to the correct executable path (/Applications/MAMP/bin/php/php5.4.4/bin/php), PHP ini file (/Applications/MAMP/bin/php/php5.4.4/conf/php.ini), the SAPI type to "CLI" and the PHP debugger to "XDebug".
Checked the Enable CLI Debug checkbox.
Checked the Break at first line checkbox.
In my debug configurations, I added a PHP Web Application and set it's preferences as follows:
In the Server tab I set the PHP server created above, set the file correctly, and set the URL correctly.
Here is a snippet from the xdebug log when Eclipse tries to connect:
Log opened at 2013-01-18 17:33:48
I: Checking remote connect back address.
I: Remote address found, connecting to ::1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Applications/MAMP/htdocs/projectname/index.php" language="PHP" protocol_version="1.0" appid="703" idekey="mparker17"><engine version="2.2.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2013-01-18 17:33:49
This seems to indicate to me that Eclipse isn't talking to xdebug, but I'm stumped as to why that would be happening.
JIT remote sessions are off
Turn it on.
Related
I am on centos 8 and using the wget command to download some files, I am able to do so on certain websites but not on others. here is an example that works for me
wget https://forums.centos.org/index.php
--2021-07-26 20:50:40-- https://forums.centos.org/index.php
Resolving forums.centos.org (forums.centos.org)... 35.178.235.168
Connecting to forums.centos.org (forums.centos.org)|35.178.235.168|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.php’
index.php [ <=> ] 49.80K 319KB/s in 0.2s
2021-07-26 20:50:41 (319 KB/s) - ‘index.php’ saved [50997]
and here is an example that doesn't
wget -d https://www.bioinformatics.babraham.ac.uk/projects/fastq_screen/_build/html/index.html
DEBUG output created by Wget 1.19.5 on linux-gnu.
Reading HSTS entries from /home/tuser1/.wget-hsts
URI encoding = ‘UTF-8’
Converted file name 'index.html' (UTF-8) -> 'index.html' (UTF-8)
--2021-07-26 20:27:16-- https://www.bioinformatics.babraham.ac.uk/projects/fastq_screen/_build/html/index.html
Certificates loaded: 147
Resolving www.bioinformatics.babraham.ac.uk (www.bioinformatics.babraham.ac.uk)... 149.155.133.4
Caching www.bioinformatics.babraham.ac.uk => 149.155.133.4
Connecting to www.bioinformatics.babraham.ac.uk (www.bioinformatics.babraham.ac.uk)|149.155.133.4|:443... Closed fd 3
failed: Connection timed out.
EDIT: I have tried pinging as well, I can ping yahoo.com but cannot ping google.com. Some websites are working some are not with ping as well.
I have disabled the firewall (firewalld) and tried to use the curl -O command as well to download but have not found a solution for this. Please let me know if there is any way to fix this
I have tried everything I can to get xdebug running with NetBeans. I have tried every suggestion on every forum I could find, but none have helped. No matter what I do, I ALWAYS get the dreaded "Waiting For Connection (netbeans-xdeubg)" and nothing happens.
Win 10. Apache running locally. Virus and Firewall have both been disabled. Listening on 9001 (I also tried 9000, no change).
relevant php.ini:
[XDebug]
zend_extension = php_xdebug-2.5.4-5.6-vc11.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\temp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_log="c:\temp\xdebug.txt"
xdebug.trace_output_dir = "c:\temp"
; 3600 (1 hour), 36000 = 10h
xdebug.remote_cookie_expire_time = 36000
xdebug.var_display_max_data = 2048
Net Beans project config:
Debugger Proxy: 127.0.0.1, Port 9001
Net Beans php debugging (Tools->Options->PHP->Debugging):
Debugger Port: 9001
Session ID: netbeans-xdebug
Max Data Length: 2048
[EDIT: #lazyone]
After NetBeans Launch and manually opening browser tab:
C:\WINDOWS\system32>netstat -o -n -a -b (excluded any non-9001 results):
TCP 0.0.0.0:9001 0.0.0.0:0 LISTENING
[netbeans64.exe]
TCP 127.0.0.1:9001 127.0.0.1:63119 ESTABLISHED
[netbeans64.exe]
TCP 127.0.0.1:9001 127.0.0.1:63123 ESTABLISHED
[netbeans64.exe]
TCP 127.0.0.1:63119 127.0.0.1:9001 ESTABLISHED
[netbeans64.exe]
TCP 127.0.0.1:63123 127.0.0.1:9001 ESTABLISHED
[httpd.exe]
TCP [::]:9001 [::]:0 LISTENING
[netbeans64.exe]
When I run the project, it sits and waits; browser does not react. When I kill debugging session, the browser immediately pulls up a tab with the proper url (http://local.ct.com/info.php?XDEBUG_SESSION_START=netbeans-xdebug). I have tried manually starting that URL when the IDE is waiting, but nothing changes.
Note that if I examine the remote log when I start the debugging from NetBeans (waiting...) then stop it, I get the following in the log:
Log opened at 2017-10-11 18:18:26
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 127.0.0.1:9001.
E: Time-out connecting to client. :-(
Log closed at 2017-10-11 18:18:26
If instead I start debugging in Netbeans (waiting...), then manually open the tab (still waiting...), then stop it, I get the following in the log:
Log opened at 2017-10-11 18:21:29
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 127.0.0.1:9001.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/userdata/CMP/ct/cmp/ct/htdocs/info.php" language="PHP" xdebug:language_version="5.6.1-dev" protocol_version="1.0" appid="13596" idekey="netbeans-xdebug"><engine version="2.5.4"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2017 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2017-10-11 18:21:34
Log opened at 2017-10-11 18:21:34
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 127.0.0.1:9001.
E: Time-out connecting to client. :-(
Log closed at 2017-10-11 18:21:34
I have been working on this a ridiculously long time. Any help would be GREATLY appreciated!
httpd.conf set listen:9080 (listen 80 would not work with windows 10 visual studio is somehow stopping it working.)
so url that works is http://localhost:9080/project2
php.ini settings appeared correctly in phpinfo()
[xdebug]
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost:9080
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
and set in eclipse
preferences -> php -> Servers -> edit
Base URL: http://localhost:9080
Local Web Root : C:\wamp\bin\php\php5.5.12
Servers -> What is path mapping?
Path on Server ? http://localhost:9080/project2
Local Path ? C:\Apache24\htdocs\project2
Set PHP Executables as follows:
Executable Path: C:\wamp\bin\php\php5.5.12
php.ini: C:\wamp\bin\php\php5.5.12\php.ini
Debug -> Run Configurations -> Debugger -> Configure
Accept Remote Session: tried localhost and prompt
Tried in Chrome and Opera they both run without stopping.
Can debug by printing to page though would like to use debugger.
Cannot think of any other reason debug set and green in chrome. Tried disabling it and selecting debug again.
Please reply soon.
I am maintaining a servlet application previously developed in Eclipse Helios. I have the servlet instance war file and it runs fine in my Tomcat 7.0 on windows and I receive the correct web responses in SoapUI. It runs with SSL encryption and the url in SoapUI states;
https://localhost:8443/ProjectName/etc/etc
But after retrieving the original code from SVN into Eclipse Helios, I can get it to start okay running through the imported Tomcat but it does not seem to start using SSL in Eclipse Helios and the URL in the Eclipse tab states;
http://localhost:8000/ProjectName/etc/etc
And so when I attempt to run a web request in SoapUI it reacts like the servlet instance is not running. What am I doing wrong?
This solution is supplied for MAC, can follow the same strategy for windows as well.
Step 1) Generate the certificate with java keytool utility by navigating to bin folder of java installation directory
LM-MAA-22004958:etc rkala$ cd /Applications/corona-java-1.1.0/jdk-7u45-macosx-x64/Contents/Home/bin
LM-MAA-22004958:bin rkala$ keytool -genkey -alias myappcert -keyalg RSA -keystore myapp.keystore
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: localhost.xyz.com
What is the name of your organizational unit?
[Unknown]: my
What is the name of your organization?
[Unknown]: my
What is the name of your City or Locality?
[Unknown]: my
What is the name of your State or Province?
[Unknown]: my
What is the two-letter country code for this unit?
[Unknown]: my
Is CN=localhost.xyz.com, OU=my, O=my, L=my, ST=my, C=my correct?
[no]: yes
Enter key password for <myappcert>
(RETURN if same as keystore password):
Step 2): Copy the generated myapp.keystore file to tomcat /conf directory
LM-MAA-22004958:bin rkala$ mv myapp.keystore /Users/rkala/Downloads/apache-tomcat-7.0.93/conf
LM-MAA-22004958:bin rkala$ cd /Users/rkala/Downloads/apache-tomcat-7.0.93/bin
LM-MAA-22004958:bin rkala$ ./startup.sh
Using CATALINA_BASE: /Users/rkala/Downloads/apache-tomcat-7.0.93
Using CATALINA_HOME: /Users/rkala/Downloads/apache-tomcat-7.0.93
Using CATALINA_TMPDIR: /Users/rkala/Downloads/apache-tomcat-7.0.93/temp
Using JRE_HOME: /Applications/corona-java-1.1.0/jdk-7u45-macosx-x64/Contents/Home
Using CLASSPATH: /Users/rkala/Downloads/apache-tomcat-7.0.93/bin/bootstrap.jar:/Users/rkala/Downloads/apache-tomcat-7.0.93/bin/tomcat-juli.jar
Hit the browser with url https://localhost:8443 and you are good to go
Step 3) Modify both server.xml with the same config provided below
1.Tomcat server.xml -> Path: /Users/rkala/Downloads/apache-tomcat-7.0.93/conf/server.xml
2.Under eclipse workspace server folder,modify the server.xml here as well
Add the tls config below this section of commented code. I used port 8443 for https
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector
SSLEnabled="true"
clientAuth="false"
keyAlias="myappcert"
keystoreFile="/Users/rkala/Downloads/apache-tomcat-7.0.93/conf/myapp.keystore"
keystorePass="password which you supplied while generating the certificate using keytool"
maxThreads="200"
port="8443"
scheme="https"
secure="true"
sslProtocol="TLS"
/>
Step 4) Catalina policy permission:
Modify the catalina.policy file located in /conf folder of tomcat installation directory
Search for below keyword(grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar) and replace all the code with single line as mentioned below
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
permission java.security.AllPermission;
};
Step 5) Modify the eclipse.ini file and add the below entries and then restart the eclipse.
-vmargs
-Djavax.net.ssl.trustStore=/Users/rkala/Downloads/apache-tomcat-7.0.93/conf/myapp.keystore
-Djavax.net.ssl.trustStorePassword=password which you supplied at step 1
Now you should be able to launch the application and will be able to access it via https
I assume you are referring to running tomcat from within Eclipse. By default the server instances managed by Eclipse (projects in their own right) each have their own separate copies of the tomcat config files (server.xml, context.xml, tomcat-users.xml etc) based on the locally installed runtime version selected at creation. So if the SSL connector is not enabled within that configuration then it won't be started. This allows you to have more than one tomcat instance running at the same time, each with a different config.
To edit the configuration for an Eclipse managed tomcat instance, look for Servers in the project explorer, open your instance and edit the server.xml to uncomment the SSL connector tag which will look something like:
<Connector SSLEnabled="true" clientAuth="false" maxThreads="150" port="8443" protocol="HTTP/1.1" scheme="https" secure="true" sslProtocol="TLS"/>
You may also need to create a keystore for tomcat if you haven't already - see the docs for more info: http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html.
Restart tomcat from within Eclipse and try the secure address. Hope that helps.
I deleted the server in Eclipse and add it again and now everything appears to be working. Thanks to all who viewed and inputted.
I'm trying to get moov running on port 8080 but am getting the error:
$ curl -s -i http://mlocal.nytimes.com:8080/
HTTP/1.0 534 Internal Server Error
Connection: close
Content-Type: text/plain;
Content-Length: 69
Host header 'mlocal.nytimes.com:8080' did not match project rewriters
I'm starting the server with:
$ sudo moov server -p=8080 --auto-hosts
(It appears to work fine on port 80.)
There's an additional step you need to take when you manually specify a port to run on.
Go into the project files and open config.json
Append :8080 to the domain names specified like this:
"$.nytimes.com:8080 => www.nytimes.com",
etc..