Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6330723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:55:23+00:00 2026-05-24T17:55:23+00:00

Since I develop on localhost but deploy elsewhere, and since I don’t want to

  • 0

Since I develop on localhost but deploy elsewhere, and since I don’t want to have to force my sites to be under a Windows partition’s root directory (currently F:\web_dev\htdocs), code like this:

require_once($_SERVER['DOCUMENT_ROOT'] . '/projXY/database/database_common.php');
OdbcExec($sql); // defined in the file above

causes Netbeans to issue a “Warning: unknown function”.

Now, I could get round this by using a directory structure like :

F:\project_1  
F:\project_2  

instead of

F:\web_dev_htdocs\project_1  
F:\web_dev_htdocs\project_2  

and then using

require_once('/database/database_common.php');

BUT that imposes constraints on where the end-user an install my site.

Simplest by far would be to tell NetBeans which local directory corresponds to $_SERVER['DOCUMENT_ROOT'], but I can’t find a configuration option for that. I am sure this is a common problem. Any suggestions?


Update: NetbBeans v7.0.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:55:24+00:00Added an answer on May 24, 2026 at 5:55 pm

    Simply add the /path/to/projXY/database/ directory to your project’s include path. Netbeans will then pick up the files there and use them as code references.

    http://netbeans.org/kb/docs/php/project-setup.html#phpIncludePath

    Addendum

    Relying on $_SERVER['DOCUMENT_ROOT'] is generally a bad idea. For one, it eliminates the ability to run parts of your application via the console / command line.

    You should instead either use configurable, absolute paths to shared libraries or do as in Brandon’s answer and use a relative path from __DIR__ (PHP 5.3) or dirname(__FILE__)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it worth it to develop WAP webpage for cellular since now cellular have
I develop websites since last two years now and I have hard time learning
I develop a c++ CGI app that is used under Windows and Linux. It
I have to develop an application for Windows Mobile 6.x and version 7 and
Since I started to develop in a test/behavior driven style, I appreciated the ability
Since CS3 doesn't have a web service component, as previous versions had, is there
Since the WMI class Win32_OperatingSystem only includes OSArchitecture in Windows Vista, I quickly wrote
I develop applications using the ASP.NET framework for my academic organization. We also have
I'm working on a new security infrastracture for my organization. Since we develop systems
I feel a bit stupid since I develop android apps for a while now.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.