xdebug in xampp doesn't work on netbeans - netbeans

I try to config xdebug but doesn't work I use:
XAMPP 1.7.4 , Netbeans 7.0
Xdebug installed: 2.1.0rc1
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC6 - Architecture: x86
Zend Server: no
PHP Version: 5.3.5
Zend API nr: 220090626
PHP API nr: 20090626
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\WINDOWS
Configuration File: C:\xampp\php\php.ini
Extensions directory: C:\xampp\php\ext
And php.ini:
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.collect_includes = 1
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.default_enable = 1
xdebug.extended_info = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = "DBGp"
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000
Now the problems:
Menu attach Debugger is still disabled or grayed out.
When I try to debug the break point is never hit. Scripts run like a normal.
Following is the URL of I get when I click Debug main project:
http://localhost/index.php?XDEBUG_SESSION_START=netbeans-xdebug
When I close the browser debugger does not stop. It shows the waiting for connection status.
When I click the stop debugging button in NetBeans gives a messagebox There is no connection from xdebug detected with in some seconds xdebug is not configured or xdebug is not installed.
Please guide me to resolve the above mentioned issues and debug the project.

First are you able to see xdebug in http://localhost/xampp/index.php ? If NOT then probably you are NOT editing the right php.ini file? Seems like XAMPP is using the php.ini file in:
c:\xampp\apache\bin\php.ini
Enter your configuration for xdebug in that file, restart Apache and you should be able to connect.
There was no need for me to change anything in Netbeans to get it to work.
Screenshots here: http://rudyegenias.wordpress.com/2011/07/03/xampp-xdebug-xdebug-not-showing-in-phpinfo/

? to use XDebug on Netbeans & XAMPP
use http://xdebug.org/wizard.php to inspect your system and download best xdebug.dll
place that .dll in C:/xampp/php/ext
edit C:/xampp/php/php.ini adding following
[XDebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.2.3-5.5-vc11.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.show_local_vars=on
xdebug.output_buffering=off
restart Apache web server
I've struggled with a lot of other setting but this is best to do the job

Related

Xdebug is running but not debugging on laragon

I have set up the Xdebug correctly and I can see it is running but does not debugging.
Also I have set up php.ini
[xdebug]
xdebug.remote_enable=1
xdebug_remote_autostart=1
;zend_extension=xdebug
zend_extension = "C:\laragon\bin\php\php-7.4.19-Win32-vc15-x64\ext\php_xdebug-3.0.4-7.4-vc15-x86_64.dll"
xdebug.remote_host = "http://127.0.0.1:8000/"
enter code here

How can I debug odoo 9 in eclipse? [Linux]

I have eclipse Neon in Linux Ubuntu 16.04
When I run a odoo server, it works everything fine in port 8069
But, when I debug the same odoo server, (now, the port is 8072) it appears to freeze in a infinite loop. In the browser doesn't appear anything (Waiting for localhost...), and the log shows this:
...
25138 INFO mydb openerp.modules.loading: 81 modules loaded in 0.73s, 0 queries
25138 INFO mydb openerp.modules.loading: Modules loaded.
25138 INFO mydb openerp.addons.base.ir.ir_http: Generating routing map
192.168.1.31 - - [2016-09-12 12:14:51] "GET / HTTP/1.1" 200 24082 21.358104
25138 INFO mydb openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
This is my odoo9-server.conf (renamed openerp-server.conf):
[options]
admin_passwd = myAdminPass
db_host = False
db_port = False
db_user = myUserName
db_password = myDatabasePass
addons_path = /etc/odoo/server/addons,/etc/odoo/server/addons_extra
logfile = None
xmlrpc_port = 8069
log_level = debug
Is there something wrong?
To debug your odoo+python code in eclipse, start eclipse in debug perspective and follow the given steps:
1: Stop your Odoo running server by pressing "ctr+c".
2: In eclipse go to Menu "Run/Debug Configurations". In configuration window under "Python Run", create new debug configuration(Double click on 'Python Run').
3: After creating new debug configuration follow the given steps:
3.1: In "Main" tab under "Project", select the "server" project or folder (in which Odoo Server resides) from your workspace.
3.2: Write location of 'openerp-server' or 'odoo.py' under "Main Module".
Ex: ${workspace_loc:odoo/openerp-server}.
3.3: In "Arguments" tab under "Program Arguments", click on button "Variables" and new window will appear.
3.4: Then create new "Variable" by clicking on "Edit Variables" button and new window will appear.
3.5: Press on "New" button and give your addons path as value.
Ex: --addons ../addons,../your_module_path
3.6: Press Ok in all the opened windows and then "Apply".
4: Now into "PyDev Package Explorer" view go to odoo and right click on "openerp-server" or odoo.py file, Select 'Debug As --> Python Run'.
5: Now in "Console" you can see your server has been started.
6: Now open your .py file which you want to debug and set a break-point.
7: Now start your module's form from 'gtk' or 'web-client' and execution will stop when execution will reach to break-point.
8: Now enjoy by debugging your code by pressing "F5, F6, F7" and you can see value of your variables.
Source: https://stackoverflow.com/a/12298831/1312904
To invoke pdb, add this line
import pdb; pdb.set_trace() anywhere you want to set a breakpoint
and then start your odoo with the --debug flag set, something along the lines of
./odoo.py --addons=addons,myaddons --debug
and then when you execute an action on the server that hits the point where you invoked pdb, the execution will immediately stop and you'll have a pdb prompt that you can use to debug
Finally I got the solution.
In the Debug Configurations, I changed the content of Main Module and I wrote this:
${workspace_loc:my_project/openerp-gevent}
The important part is the openerp-gevent
Now, the debug works fine

XDebug doesn't stop on breakpoints set on Yii controllers' actions

I code in Yii framewor, using Netbeans 8.0.1 and also Eclipse. My local developement environment is build on XAMPP. I can see, that breakpoints set anywhere within Wordpress code works just fine. But, when I try to set a breakpoint on any Yii's controller or action, XDebug won't stop at that point. It only work on index.php of my project.
However, xdebug_break() work for controllers, but not actions.
My php.ini settings for XDebug are:
[XDebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.2.5-5.5-vc11.dll
;xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = 127.0.0.1
xdebug.trace_output_dir = "C:\xampp\tmp"
xdebug.idekey=netbeans-xdebug
xdebug.remote_port=9000
xdebug.remote_log = "c:/xampp/tmp/xdebug_remot.log"
xdebug.show_local_vars = 9
xdebug.max_nesting_level = 250
xdebug.auto_trace=1
xdebug.remote_server = 127.0.0.1
I'm trying to deal with this problem for about a week and still didn't come with any solution.

Can't launch browser with Selenium Remote Driver

I don't know why but I cannot launch browser using the below code. I am using EPIC on eclipse. I have installed required selenium modules for this.
I get this error when I run below mentioned code: "Could not connect to SeleniumWebDriver at C:/ProgramFiles/Perl/site/lib/Selenium/Remote/Driver.pm line 220"
Any help is appreciated.
Here is my code:
use Selenium::Remote::Driver;
my $driver = new Selenium::Remote::Driver(browser_name => 'firefox', port => 5555,
platform => 'WINDOWS');
$driver->get('http://www.google.com');
print $driver->get_title();
$driver->quit();
It might be closing the page before you notice it? Also, I think by default the port number selenium listens on is 4444.
Try this:
use Selenium::Remote::Driver;
my $driver = new Selenium::Remote::Driver(browser_name => 'firefox', port => 4444,
platform => 'ANY',);
$driver->get('http://www.google.com');
sleep(200);
print $driver->get_title(),"\n";
$driver->quit();
I changed the Selenium version to 2.31 and it worked. Previously I was using 2.28 which had incompatibility with FF 19
Charles, my PC was updated with new Java version and so my server start up file was failing to start the server. I corrected the start up file with correct java path and it launches the browser.
But I don't know why it gives blank page as it should open google.com
before run the code you should start the remote server.
Enter the path as below where your chrome driver and jar file are exited in your system and
Go to the command prompt an run the following command- please
java -Dwebdriver.chrome.driver="\Enter folder path\chromedriver.exe" -jar \Enter folder path\selenium-server-standalone-2.53.0.jar
and if you are using Firefox then write the following code.
my $driver = Selenium::Remote::Driver->new();
for chrome user following -
my $driver = Selenium::Remote::Driver->new(browser_name => 'chrome');

I'm getting a blank screen when trying to connect Codeigniter to postgresql

I'm using codeigniter 1.7.2 on WAMP with php_pgsql and php_pdo_pgsql extensions enabled here is my configuration :
$active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "postgres";
$db['default']['password'] = "mypassword";
$db['default']['database'] = "mydatabasename";
$db['default']['dbdriver'] = "Postgre";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
when i open my application in a web browser all the existing urls return empty page when i view the source there is nothing
What am i missing ?
Edit
after cheking wamp log i found this :
[Tue Jul 13 23:30:05 2010] [notice]
Parent: Created child process 4944 PHP
Warning: PHP Startup: Unable to load
dynamic library
'c:/wamp/bin/php/php5.3.0/ext/php_pgsql.dll'
- The specified module could not be found.\r\n in Unknown on line 0
Warning: PHP Startup: Unable
to load dynamic library
'c:/wamp/bin/php/php5.3.0/ext/php_pgsql.dll'
- The specified module could not be found. in Unknown on line
0 [Tue Jul 13 23:30:05
2010] [notice] Child 4944: Child
process is running
any idea how to solve this ?
I think you must change Postgre to postgres, lowercase with a trailing s (per manual: http://codeigniter.com/user_guide/database/configuration.html).
There might be other problems. Are interesting PHP errors in the Apache logs?
I'm running WAMP 2.2 on Windows 7 64 bit with POSTGRES 9.1, and adding the LoadFile line to httpd.conf cured the "blank page" syndrome with Codeigniter entirely:
<VirtualHost 127.0.0.1>
LoadFile "C:/Program Files/PostgreSQL/9.1/bin/libpq.dll"
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>
Naturally, if you are not using Postgres 9.1, or your path to the .dll is different in some way, edit the LoadFile directive accordingly.
Turn off pconnect and see if that works out.
Anyway i installed WAPP and everything works fine now i think the php_pgsql.dll was not compatible with PHP 5.3
Check if the DLL ("c:/wamp/bin/php/php5.3.0/ext/php_pgsql.dll") referred in the apache error log really exists. If it does then look into this answer.
enable php_pgsql extension from system tray => wamp icon => PHP => PHP Extensions => php_pgsql.
This solved my problem.