NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

xDebug on remote server(VirtualBox)

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
Apach3



Joined: 24 Mar 2009
Posts: 1

PostPosted: Tue Mar 24, 2009 6:22 pm    Post subject: xDebug on remote server(VirtualBox) Reply with quote

Hi there,

I've set up linux server (Apache2, MySQL) in VirtualBox but I'd like to have the virtual machine only as a server and run NetBeans in my Vista OS. Everything works fine, but I can't debug my projects, which is the main reason for installing server in VirtualBox since xDebug does not work on Vista. I thought that I have set up the xDebug extension incorrectly but when I run my project in NetBeans on linux ( in Virtual Machine ) everything works fine.

I don't have FTP server on linux. I have shared folder which is the document root for apache, so I don't have to have 2 folders of the same project. ( hope I described it well ).

Virtual machine has it's own IP address and I've configured xdebug.remote_host for that IP.

Could someone help me? I really don't know how to do this, I've tried everything I know.

Thank you very much for any help or suggestions.

Regards.
Filip
Back to top
a b
Posted via mailing list.





PostPosted: Thu Mar 26, 2009 7:11 am    Post subject: xDebug on remote server(VirtualBox) Reply with quote

hi,

"since xDebug does not work on Vista."....
It work fine for me,
I have installed the wamp pack.
your configuration may works, but may be slower

regards

ab
Back to top
Pete Ford
Posted via mailing list.





PostPosted: Thu Mar 26, 2009 9:31 am    Post subject: xDebug on remote server(VirtualBox) Reply with quote

Apach3 wrote:
Quote:
Hi there,

I've set up linux server (Apache2, MySQL) in VirtualBox but I'd like to have the virtual machine only as a server and run NetBeans in my Vista OS. Everything works fine, but I can't debug my projects, which is the main reason for installing server in VirtualBox since xDebug does not work on Vista. I thought that I have set up the xDebug extension incorrectly but when I run my project in NetBeans on linux ( in Virtual Machine ) everything works fine.

I don't have FTP server on linux. I have shared folder which is the document root for apache, so I don't have to have 2 folders of the same project. ( hope I described it well ).

Virtual machine has it's own IP address and I've configured xdebug.remote_host for that IP.

Could someone help me? I really don't know how to do this, I've tried everything I know.

Thank you very much for any help or suggestions.

Regards.

Filip
I was playing with this idea recently (while my main dev machine had
some hardware issues)
My set up is a Vista laptop, with a VirtualBox VM running OpenSuSE 10.3,
apache, PHP, PostgreSQL etc., but not an FTP server
The VM is set up to use Host Interface networking, and it's IP is
192.168.0.23
The Vista machine has IP 192.168.0.24

In the VM, /etc/php5/apache/php.ini (the php.ini used in mod_php) I have
zend_extension=/usr/lib/php5/extensions/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=192.168.0.24
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey=netbeans-xdebug

In the Vista host I have created a directory C:\srv\www\vhosts\dev,
which is then set as a shared folder in VirtualBox with the name trmsdev
(my project is called 'trms'...)
The VM mounts this shared folder with "mount -t vboxsf trmsdev
/srv/www/vhosts/dev"
The VM Apache configuration has a virtual host defined which uses
/srv/www/vhosts/dev as its web root: that virtual host listens on the
name "trmsdev"

NetBeans on the Vista host is set up to use a "local" web server,
looking at "http://trmsdev/index.php".
The project is also set to copy files to "C:\srv\www\vhosts\dev", which
should ensure that the VM sees the changes I make in NetBeans.

One gotcha here - NetBeans only copies files that have changed to the
"copy to" folder - if your project already exists before you set this
folder (which, if you follow this process, it does),
then you need to make sure the current versions of the project files are
copied to C:\srv\www\vhosts\dev (or wherever)

Now I start Apache on the VM, and NetBeans on the host, and open the
project.

Hopefully, if you start debugging the project now, the browser will open
and you'll hit a break point at the start of index.php

The important bits, at least as far as this Vista NetBeans / Linux
Apache set-up is concerned, are:

1. I found that I have to match the paths (give or take a C:\ ) on the
VM and the Vista host, otherwise the debugger would not find any other
files than the first one (index.php). That causes a problem in itself,
because when a file is opened by the debugger for you to step through,
it is the COPY of the file, not the one in your project folder. Make
sure you EDIT the right version... I think this is a bug, because it
doesn't happen with NetBeans on Linux. I'm just not sure whether the bug
is in NetBeans or XDebug...

2. The xdebug.remote_host is the machine that is doing the debugging,
not the machine where the PHP is running. So make sure your remote_host
setting points to you Vista host IP address, rather than your VM.

Having written all this, I suspect that your only real problem is the
last bit... :)

Cheers
Pete
Back to top
Jeff Rubinoff
Posted via mailing list.





PostPosted: Thu Mar 26, 2009 10:17 am    Post subject: xDebug on remote server(VirtualBox) Reply with quote

Pete, Apache3,
If you're not completely dedicated to having linux on your VirtualBox,
you can accomplish exactly what you're trying to do with a
pre-configured OpenSolaris image on your VirtualBox. (Hey, it's all
UNIX, right?) All the setup is done for you, including XDebug. You just
need to configure port forwarding and some transport details in
VirtualBox. See http://www.netbeans.org/kb/docs/php/webstack.html for
details.

Jeff

Pete Ford wrote:

Quote:
Apach3 wrote:

Quote:
Hi there,

I've set up linux server (Apache2, MySQL) in VirtualBox but I'd like
to have the virtual machine only as a server and run NetBeans in my
Vista OS. Everything works fine, but I can't debug my projects, which
is the main reason for installing server in VirtualBox since xDebug
does not work on Vista. I thought that I have set up the xDebug
extension incorrectly but when I run my project in NetBeans on linux
( in Virtual Machine ) everything works fine.

I don't have FTP server on linux. I have shared folder which is the
document root for apache, so I don't have to have 2 folders of the
same project. ( hope I described it well ).

Virtual machine has it's own IP address and I've configured
xdebug.remote_host for that IP.
Could someone help me? I really don't know how to do this, I've tried
everything I know.

Thank you very much for any help or suggestions.

Regards.

Filip

I was playing with this idea recently (while my main dev machine had
some hardware issues)
My set up is a Vista laptop, with a VirtualBox VM running OpenSuSE
10.3, apache, PHP, PostgreSQL etc., but not an FTP server
The VM is set up to use Host Interface networking, and it's IP is
192.168.0.23
The Vista machine has IP 192.168.0.24

In the VM, /etc/php5/apache/php.ini (the php.ini used in mod_php) I have
zend_extension=/usr/lib/php5/extensions/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=192.168.0.24
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey=netbeans-xdebug

In the Vista host I have created a directory C:\srv\www\vhosts\dev,
which is then set as a shared folder in VirtualBox with the name
trmsdev (my project is called 'trms'...)
The VM mounts this shared folder with "mount -t vboxsf trmsdev
/srv/www/vhosts/dev"
The VM Apache configuration has a virtual host defined which uses
/srv/www/vhosts/dev as its web root: that virtual host listens on the
name "trmsdev"

NetBeans on the Vista host is set up to use a "local" web server,
looking at "http://trmsdev/index.php".
The project is also set to copy files to "C:\srv\www\vhosts\dev",
which should ensure that the VM sees the changes I make in NetBeans.

One gotcha here - NetBeans only copies files that have changed to the
"copy to" folder - if your project already exists before you set this
folder (which, if you follow this process, it does),
then you need to make sure the current versions of the project files
are copied to C:\srv\www\vhosts\dev (or wherever)

Now I start Apache on the VM, and NetBeans on the host, and open the
project.

Hopefully, if you start debugging the project now, the browser will
open and you'll hit a break point at the start of index.php

The important bits, at least as far as this Vista NetBeans / Linux
Apache set-up is concerned, are:

1. I found that I have to match the paths (give or take a C:\ ) on the
VM and the Vista host, otherwise the debugger would not find any other
files than the first one (index.php). That causes a problem in itself,
because when a file is opened by the debugger for you to step through,
it is the COPY of the file, not the one in your project folder. Make
sure you EDIT the right version... I think this is a bug, because it
doesn't happen with NetBeans on Linux. I'm just not sure whether the
bug is in NetBeans or XDebug...

2. The xdebug.remote_host is the machine that is doing the debugging,
not the machine where the PHP is running. So make sure your
remote_host setting points to you Vista host IP address, rather than
your VM.

Having written all this, I suspect that your only real problem is the
last bit... :)

Cheers
Pete





Back to top
n2geoff



Joined: 11 May 2009
Posts: 1

PostPosted: Mon May 11, 2009 3:55 pm    Post subject: Kudos Reply with quote

@pete
Your info helped, especially #2, doh! -- thanx
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo