views:

129

answers:

2

So I have this project in PHP where I have some include files next to the wwwroot (or doc-root) folder instead of under the wwwroot folder. I need however to run/debug this project. in the project properties I can select a index file (index.php) but it's under the doc-root folder, so the Project URL makes http://myprojectmachine/doc-root/index.php instead of ..://myprojectmachine/index.php. Manually typing in the index file doesn't work as NetBeans states the file isn't found. How can I overcome this in an elegant way?

+1  A: 

I just had the same problem yesterday. You can select the correct document root by right-clicking on your project, selecting Properties and clicking the Browse button next to "Web root" in the Sources panel.

wimvds
Thank you so much!
Henri
A: 

you can set the project URL when you create the project, which is the best time to do it if you think of it. It's the bottom option on the page where you choose the directory for the code.

Although, since you've already created it, you can easily change it in the project properties. I'm not 100% sure if this will work if you're doing it on your local machine; the only web-based projects I have open right now I'm working on through SFTP in NetBeans, but changing the settings to local web server, it shows the same option:

  1. In the Projects pane, right-click on the project, and select Properties
  2. Go to Run Configuration in the left-hand side of the window
  3. You should see Project URL as the third option, here you set what you want as the root URL for the project. So you would simply have http://myprojectmachine/
Slokun
I know how to change it, but for debugging you need to put an index file as well, which has to be valid, according to the directory structure at least. And yes I'm working via SFTP too.
Henri