开发者

NetBeans PHP run configuration: how can I omit the doc-root folder?

开发者 https://www.devze.com 2022-12-24 14:25 出处:网络
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 pro

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?


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.


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/
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号