NetBeans PHP Project on Dreamhost Advanced Setup

This guide will show you how to setup a PHP project in NetBeans covering a complicated situation, such as files behind public root. PHP support is new in NetBeans so hopefully this guide will help some new comers to NetBeans that want to use it for PHP websites.

What some may experience when first using an IDE such as NetBeans or Dreamweaver is the native tendency for these programs to guess what is best for you when it comes to your project paths and live site paths. One may be fustrated that when running their project off the IDE it will point them to someting like or upload their files to a similar wrong location in FTP. Especially when trying to mirror the directory structures and names locally and on the server. With the proper setup this can be avoided.

This fake project will cover all the following situations:

  • You want some system files will be behind public web root.
  • You are using Dreamhost. (with some adjustments to the guide this can work for any host)
  • You are building a website for a domain you are temporarily pointing to a placeholder page or DNS isn’t setup for it.
  • You already have another working domain besides the new one that you want to run the development on.

The domain you have not purchased or setup will be called The working domain will be the same way…
If  your new domain is already setup on dreamhost you can use a subdomain to hide your project.
If you already have your domain you can skip the mirror process.

  1. Login to you Dreamhost account
  2. Create a subdomain mirror to

Download NetBeans. Get the PHP version at the minimum.

You can replace with if you need to.

  1. Create a new project with these settings
    • Run As Remote Web Site FTP
    • Project URL: (don’t forget the trailing slash)
    • Setup FTP connection by clicking Manage.
    • Upload Directory: / (a single forward slash)
      (the upload directory is not because the folder in your project will be uploaded into /.)
    • Upload Files setting Run / Manual is your preference.
  2. Delete the new index.php file
  3. Right-click on Source Files and create a new folder in the left pane called
  4. Create any folders you need under Source Files that will be outside of public. You can do this now or later when you are working on your project.
  5. Create a new PHP page under called index.php
  6. Go to File > Project Properties
    • Under sources change Web Root to
    • Under Run Configuration > Index File hit browse and select index.php under You should see below the Arguments box

Now your files will upload to the correct directories behind and inside of the public folder. Also, your files behind root will be included in your NetBeans project. When you hit run it will open your browser to the temporary domain you have mirrored and run index.php.

Things to note:

You can configure these individually:

  • What local folder in your project is the web root
  • The live/devel project url
  • Your index file location
  • FTP upload directory

This gives you flexibility. Make sure you set your Web Root folder under Properties > Sources before choosing your Index File under Run Configuration.