wantTheBest
wantTheBest

Reputation: 1720

xdebug, php on remote server, netbeans

I have my 1and1 hosted web site. I've got server-side php I need to debug. All I've found mentions running/installing xdebug when you have a local web server with php and mysql on a local web server.

However, I'm using the remote web server hosted at 1and1 hosting. I'm using and loving netbeans, wow great IDE.

Anyways, how (if it's even possible) can I install then use the xdebug debugger to debug my php code running at 1and1 from within Netbeans?

I'm wondering if it is my hosting company (1and1) that has to have xdebug installed. I'm running the latest version of Netbeans but when I press the debug button on the toolbar I see an error message popup that says

"There is no connection from xdebug detected within 40 seconds. The reasons could be that xdebug is neither installed nor properly configured. Be sure that your php.ini file contains these entries:

xdebug.remote_enable=on  
xdebug.remote_handler=dbgp  
xdebug.remote_host=localhost (or hostname)  
xdebug.remote_port=9000

So I searched my harddisk, and despite having installed the full Netbeans IDE, I have no php.ini file.

So can I make xdebug work remotely, ie. can I debug my php code as it runs on the remote 1and1 web server, using Netbeans and xdebug?

I've only been using Netbeans for 2 days and for all I know, xdebug is not even a part of Netbeans. Reason I say that is, I can 'run' my php remotely just fine -- it executes on the remote 1and1 web server when I push 'run' inside Netbeans -- and then the client side output on my local machine is correct. But I cannot step into the code with xdebug by pressing the 'Debug' button on the Netbeans toolbar -- is it possible xdebug did not get installed correctly with Netbeans?

Upvotes: 2

Views: 3454

Answers (1)

Sylver
Sylver

Reputation: 8967

xdebug should be installed inside the php folder and of course the php folder is located on the server where php is installed... at your hosting provider.

I would not expect an hosting provider to install xDebug as it seems to me it would be a huge security hole.

xDebug is not part of Netbeans and it is not part of PHP by default.

Now, looking at things on a more positive viewpoint, if you are going to develop PHP, you NEED a local server. It's very unprofessional to develop code directly on the live server.

Grab a copy of xampp and install it on your computer. Grab a copy of xdebug and install it following the instructions. Restart Apache. There, now you have a testing server.

Once you have a complete set-up on your computer, copy your PHP application's folder inside the "htdoc" folder.

NOW, and only now, should you consider developing in PHP. Develop locally, on your own testing server, xdebug will work whenever you start a debugging session from inside Netbeans.

When everything works, upload your files on your hosted space.

Upvotes: 5

Related Questions