Based on advice here at SitePoint, I have decided to move database_settings - and possibly config.php - to a directory OUTSIDE of the Web Root in Production.
The problem is that I don’t know how to create a directory outside of the “project” folder that NetBeans creates.
When I open NetBeans, this is what I see in the navigator…
It seems that Source Files represents my Web Root in NetBeans, and regardless of what I try, there is no way to create a directory outside of “Source Files” (i.e. Web Root).
So this creates the problem that there is no way to mimic in my Dev environment how things will look in Production, and that means all of my Includes will be broken when I switch over?!
What are some different ways that I can address this issue?
Until I get this resolved, it makes no sense for me to finish testing my code, because if I have to switch things in Production, then all of my testing won’t mean anything, so I am a dead-duck-in-the-water until this gets resolved?!
And I said that you probably ARE able to—although it depends more on your hosting account than NetBeans. I’m assuming that NetBeans includes FTP access.
Most web hosting accounts give you access to levels above the root folder (often called public_html). For example, they will tell you that your root folder is located at
Now, when you set up your FTP-enabled code editor to point to your hosting account, you have to nominate the remote path. If you specify it as /home/accountname/public_html/, then your code editor will only show you the files in /public_html/ and below. So if you want access to higher folders via FTP, nominate the remote path as /home/accountname/. That way, when you open the FTP connection, you wil be presented with all the files in the /accountname/ folder, which will include /public_html/, but also a ton of other stuff. Then you can work at that level or below.
So that the local files match the remote ones, I have a folder on my desktop that matches /home/accountname/, and inside that is the /public_html/ folder.
The only rider to all this is that your host may not give you control panel access to folders above the root folder. If they don’t, politely ask for your money back and get a better web host.