Newbie Looking for help to configure NetBeans & Xdebug

To all,
I am using a windows vista machine and have downloaded NetBeans 8.0
My php.ini file is in c:\windows directory

In my php.ini I have the following:
output_buffering = Off

The last lines in the file read:
; Port number must match debugger port number in NetBeans IDE Tools > Options > PHP

In NetBeans
Debugger Port 9000
Session ID netbeans-xdebug
Max Data Length 2048
Stop at First Line checked
Show requested URLs checked
Show Debugger Console checked

I am running Apache/2.2.11 (Win32) PHP/5.2.8
When I run a PHP script with the phpinfo command I don’t get anything about “XDEBUG”
In NetBeans I do not get a connect to the “XDEBUG” software and none of the of the commands under Debug are highlighted when I run in Debug mode :confused:

This is what I have under phpinfo:
The information in red is the two paths where the phpinfo seems to be looking.
Also I do not have a php.ini file in C:\Program Files (x86)\PHP.
I have “php”, “apache” and “mysql” installed separately so the only files
with php ini in the directory are:
php.ini-dist – file for new PHP installations
php.ini-recommended – copy of the php.ini (when I installed php I followed a set on instructions that said to rename the php.ini file to this)

Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\Windows\php.ini

Server Root C:/Program Files (x86)/Apache Software Foundation/Apache2.2

Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_actions mod_alias mod_asis mod_auth_basic mod_authn_default mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_setenvif mod_php5

PATH C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\PHP;C:\PROGRA~2\COMMON~1\ULEADS~1\MPEG;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files (x86)\jZip;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\WinMerge;C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.4;C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.4\

SystemRoot C:\Windows

I could not make the then current versions of Apache and PHP work together last time I tried to install everything separately. So I abandoned that idea and installed XAMPP instead. Much easier. Besides, you are using a very outdated version of PHP. 5.2 was released in 2006 and support for it ended 3 years ago. XAMPP has current versions of Apache, PHP, MySQL, and more.

I am too tired to give an in-depth response right now. I am heading off to bed momentarily. I wanted to look at this thread because I happened to upgrade to Netbeans 8 earlier this morning. I am not very knowledgeable about Netbeans. But maybe I can be helpful anyway.

Do yourself a favor and download XAMPP. It’s great. :slight_smile: And here is what I have in my XAMPP installation’s php.ini file:

zend_extension = "C:\\xampp\\php\\ext\\php_xdebug.dll"
;xdebug.profiler_append = 0
xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\\xampp\	mp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = ""
;xdebug.trace_output_dir = "C:\\xampp\	mp"

A line beginning with a semi-colon denotes a line that has been commented out and is not processed. Install XAMPP, put that in your php.ini file, and see if it works. It works for me.

Should I update my version of php? I tried to install XAMPP once before on my machine it didn’t work.

You should uninstall your Apache, PHP, and MySQL completely. PHP 5.2 is ancient. There is no point using it. The PHP binaries available on do not necessarily work with recent versions of Apache. That is the problem I had so I gave up and went with XAMPP which was much simpler.

What problem did you have trying to install XAMPP? Did you look for a solution?

Another option available for a development server is to use VirtualBox and run a virtualized Linux OS distribution. If you don’t mind using old Apache 2.2 and PHP 5.3, this would be an easy option for you. If you want to use newer software, you will have to learn to compile it yourself as official support for Apache, PHP, and MySQL by pretty much every Linux distribution is years behind the times. (I cannot understand why. :mad: )

Support for Apache, MySQL, and PHP on Windows is more an afterthought than anything.

Ok, this is what I have. I have exported my two sql databases with the information I have in them to a safe place. I have uninstalled Apache, MySQL, and PHP. So now I have have a clean install.

I went to a website called BitNami which was recommended in a earlier post.
I have downloaded and installed
XAMPP 1.8.3 which included the following:
[PHP: 5.5.11]
Server type: MySQL
Server version: 5.6.16 - MySQL

Made the following changes the the PHP.ini file: ( ones in red are the ones I added)
PHP.ini file
;JDG 04-18-14

I now receive the following error message when I run a php script which connects to the mysql database:
Warning: mysql_connect(): Access denied for user ‘root’@‘localhost’ (using password: YES) in C:\xampp\htdocs\dbconfig.php on line 2
Access denied for user ‘root’@‘localhost’ (using password: YES)
My connect code looks like this:
$conn = mysql_connect(‘localhost’, ‘root’, ‘cf1’) or die(mysql_error());
Yes I know I am using root (local machine)

Once this works over the weekend I will try to configure Netbeans & Xdebug and get them working

Thank You

Try it without the MySQL password. The default installation of XAMPP does not have a root password on the database. Unless you specified a password. If phpMyAdmin works, MySQL works. Another suggestion: run XAMPP with administrator rights if you are not. You can right-click on the XAMPP Control panel icon in your Start Menu, select Properties, click Advanced and then check the box that says to run as administrator if it is not already checked.

By the way, I never mentioned Bitnami.

$conn = mysql_connect(‘localhost’, ‘root’, ‘cf1’) or die(mysql_error());
Should read
$conn = mysql_connect(‘localhost’, ,) or die(mysql_error());

First off, you should not be using mysql_ functions anymore as they have been deprecated. In a nutshell for connecting to the database using XAMPP:

Database = ‘localhost’
User = ‘root’
Password = ‘’
Database = ‘name_of_your_database’

Use ‘root’ for the user name, an empty string (‘’) for the password, specify the name of your database.

It works. I just tested it. Using mysqli:

$db = new mysqli('localhost', 'root', '', 'my_database');

That simple. The empty string I used is two single quotes.

Line was
$conn = mysql_connect(‘localhost’, ‘root’, ‘cf1’) or die(mysql_error());
Changed to
$conn = new mysqli(‘localhost’, ‘root’, ‘’, ‘career_transitions’);

When I run a php program with a connect to the database I get anew error message
New error Message
Error. MySQL said No database selected

Database Name – career_transitions

The quotes that are in cyan are single

Forget what I said about mysqli. Use your existing code. The above still applies:

Server/host = ‘localhost’
User = ‘root’
Password = ‘’
Database = ‘name_of_your_database’

OK, code changed back to original.
Code reads as follows:
$conn = mysql_connect(‘localhost’, ‘root’, ‘cf1’) or die(mysql_error());
mysql_select_db(‘career_transitions’) or die(mysql_error());

Original Error Message:
Warning: mysql_connect(): Access denied for user ‘root’@‘localhost’ (using password: YES) in C:\xampp\htdocs\dbconfig.php on line 3
Access denied for user ‘root’@‘localhost’ (using password: YES)

Your password should be the empty string ‘’. Like this:

$conn = mysql_connect('localhost', 'root', '') or die(mysql_error());

Thank You Thank You Thank You. That worked:)
Did it work because in the mysql schema there is a table called “user” And in that table there is a Column
called “User” with a value of “localhost” and a column called “Password” and the value of that column is “empty”?

Now I will try to get Xdebug to work also

I do not know. I do know that XAMPP is intended to be used as a development server only (not for websites live on the internet) and so it has almost no security settings and no database password. Default database user is root with no password (empty string).

Make sure you see the settings I provided for php.ini above.

Make sure you read the instructions for NetBeans. In fact, I will have to do so myself. I have used NetBeans very little. I did not find the debugger difficult to use, though, as it is similar to other IDE debuggers.

Netbeans & Xdebug seem to be working fine together now. I have worked with debuggers before. Now I just have to get my wordpress stuff to work with “XAMPP” :slight_smile:

Where are you logging in from? Me United States? Thanks once again.:slight_smile: