An Oracle blog about NetBeans for PHP

Configuring a NetBeans PHP Project for WordPress

Guest Author

I've been experimenting with WordPress a little bit lately while setting up a blog on my personal web server. The installation was completely smooth, but I was interested in some of the WP internals and also wanted to get a better understanding of what it takes to develop WordPress extensions. So, I set up a NetBeans PHP project for my experiments.

I thought other folks might be interested in this, or perhaps, would like to see how to set up a project in NetBeans for their existing PHP applications in general. Therefore, I wrote this brief tutorial and published it in NetBeans wiki. In the future, I'd like to write another tutorial about developing a real WordPress plugin.

 Comments welcome.

Join the discussion

Comments ( 23 )
  • Petr Wednesday, August 6, 2008

    I have tried it and it's really very easy. It took me less than 2 minutes to run WordPress from NetBeans.



  • raymond Wednesday, August 6, 2008


    I've just uploaded an article on how to Build an Abode AIR application with NetBeans.

    You can check it out here:


    PS. Maybe you can write blog about it on this site?

  • Petr Wednesday, August 6, 2008

    It's really interesting. I will write an entry about it. In the next screencast you can show also some php features:). I like it.



  • raymond Thursday, August 7, 2008

    Many thanks Petr. Glad you liked it :)

    In the next screencast I'll try to come up with a solution that will make use of a PHP back end.

  • Varun Thursday, August 7, 2008


    I must tell you this is the first time, I have experimented with wordpress installation, as I have been using Wordpress.com blog for months now, as its free!

    After reading this,


    I have changed my mind, I would love to play with it, though locally, as I don't have a personal domain.

    Thank you for wonderful support for PHP, I am glad I no longer have to synchronize my web application made in DreamWeaver with NetBeans PHP support in 6.0 (remember?).

    I am using this after a long time, and have thought of checking out the new docs for the new support.

    Now, I have some suggestions for the Wiki you made. Read the following excerpt from the section of the Wiki-



    "We also want to copy the files to the location under the local web server's document root. Select the 'Copy files' check box and enter to root directory of the WordPress application (/home/honza/www/blog)."


    Don't you think, one should mention the root folder of the local server, rather than the one you mentioned. Actually, I configured it with XAMPP, and root folder is basically- htdocs, so I had to specify that path, then installation was done!



  • optik Friday, August 8, 2008

    Netbeans PHP support is powerfull, I like It very much, use existing sources for a new project is very usefull feature, keep working guys

  • DM Wednesday, August 13, 2008


    some body can help me?

    Please I need to debug my php project, in the first time it works, but when i'd try to continue the next breakpoint, the netbeans show me a message that the port 9.000 is ocuppied by other aplication, but if i put in other ports, happen the same error.

    I don't nowk what could happen, please how can i set this port?

    My project use diferents pages, and directories, but the debug could not pass to the first page 'index.php'

    thanks a lot, and sorry if my write english is to bad

    The message is:

  • Petr Thursday, August 14, 2008

    Hi DM,

    I'm trying to solve the same problem on users@php.netbeans.org mailing list and I'm not sure, whether you are the same person.

    Anyway, I haven't seen such behavior and my tip is that this is caused by a setting in your environment. Could you send me the output of phpinfo()?

    Do you have installed Zend debugger? It can be another guess, that xdebug is in a clash with Zend debugger, but I'm not sure.



  • Petr Thursday, August 14, 2008

    Hi Varun,

    >Don't you think, one should mention the root

    >folder of the local server, rather than the one

    >you mentioned. Actually, I configured it with

    >XAMPP, and root folder is basically- htdocs, so I

    >had to specify that path, then installation was


    I think Honza mentioned in the tutorial this folder, because his local server is set up in this way. The document root of apache can be in user dir under a folder. Usually this is public_html or www.

    NetBeans should recognized the default document root for apache. It didn't recognize in your case?



  • Edmund Friday, September 5, 2008

    Sir Petr,

    I have a problem of connecting MySQL Database.It says:

    Unable to connect to the MySQL serve. please check your setting in Properties and try again: java.sql.SQLException: Access denied for user 'root'@'localhost'(using password:YES)

    I can't continue bcoz of this....what should I do?pls. reply. can you also send more links for sample & tutorial....i really want to learn for different application in NetBeans IDE.Thanks.

  • Petr Monday, September 8, 2008

    Hi Edmund,

    sorry for the late response. I have seen similar request. Did you wrote it somewhere else too? :)

    Did you check, whether the root user has a password?



  • Chris Thursday, October 2, 2008

    Although impressive it is missing the ability to automatically upload the files on save. Unfortunately until this feature is available I'll have to stick with Dreamweaver.

  • Petr Thursday, October 2, 2008

    Personally I think that the feature automatically upload the files on save is dangerous. I use many years a cvs, which have saved me many time my work.

    On the other hand I agree that there are people, who want to use it. It's not correct that NetBeans 6.5 doesn't support this feature. It doesn't support it of the box, but you can assign a shortcut for the upload action like ALT+S and the upload action automatically saves the edited file. Also you can look here: http://blogs.sun.com/netbeansphp/entry/ftp_support_added#comment-1221149609000



  • sreejith Sunday, December 14, 2008

    does LAMP server is required for running PHP code in Netbeans IDE....plz help me........

  • Petr Monday, December 15, 2008

    Hi Sreejith,

    to run a PHP code in NetBeans you have to setup a PHP runtime. It's independent on NetBeans. NetBeans just reuses already existing environment.

    LAMP is a distribution, where you can get most important part of the PHP runtime at once (Web Server, DB server and PHP). But you can install it separately one by one or install different web server, database etc.

    If you don't know much about the PHP runtime, visit php.net. There are many useful information.



  • Dave Edelhart Tuesday, May 12, 2009

    The NetBeans xDebug seems good in the 95% use cases -- however it has one big "Epic Fail": if the class violates its interface, the debugger (and PHP as it happens) fails silently and unhelpfully. (try it out!)

    Any suggestions?

  • hamid Monday, August 3, 2009

    hi! Thank you for your support of php. i glad to write php in netbeans, its very nice! but i suggest you that support a php frameworke like prado in next versions of netbeans.

    Thank again...

  • steve Sunday, December 13, 2009

    I downloaded apache server and am trying to save a php file under htdocs but get a message saying permission denied. can anyone help? I need to save the file there in order to view it in localhost

  • gunawan Sunday, August 8, 2010


    thank you for the information,

    This was helped,

    spirit! ! ! ! !

  • Paul James Wednesday, August 18, 2010

    On a similar line, has anyone come up with a set up for Joomla?

    I would be most interested.



  • Paul James Wednesday, August 18, 2010

    Just had to do a bit of Googling so answered my own question. Some of the results could also be applied to Wordpress so worth a look-see.

    From the Joomla site - http://docs.joomla.org/NetBeans_overview and also a great video tutorial at http://www.vimeo.com/11981229.

  • PHP Guestbook Monday, November 22, 2010

    Nice post, it is helpful!

  • vikas Tuesday, January 18, 2011

    i am starting with php iin netbeans , while executing it ti showing file not ound error

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.