I am having a problem getting xampp to render an existing project I just began to work on. Its a bit of an odd configuration: This is a Mac with VMWare running a Windows 64 image. The other devs on this project are running strait Windows which is why I’m doing it this way.
The basic problem is running a php script I have inside the project folder inside htdocs. So I get this:
Fatal error: require_once() [function.require]: Failed opening required 'C:/xampp/**htdocs/includes**/page-include.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\**htdocs\mb314\index**.php on line 2
Notice that it is looking for the includes/page-includes.php inside htdocs/ when the actual location of it is htdocs/mb314/ … even though it is not having a problem finding the index.php file inside htdocs/mb314. So not sure what the error message is telling me.
Also, one of the .NET devs on this team suggested I edit my hosts file in (C:\WINDOWS\system32\drivers\etc) to add 127.0.0.1 localhost/mb314 at the bottom. But I don’t know much about the Windows environment and whether 32v64 bit could be a problem or if the VMWare might have something to do with it.
I’m pretty sure this is a basic xampp configuration problem; just with an unusual platform combination … which is why I’m asking for help.
Any suggestions would be appreciated
$_SERVER[“DOCUMENT_ROOT”] is based on your virtual host directory definition in php.ini. But you shouldn’t change it from there. You can set a global configuration variable in your php files when you’re working on a project in its own folder to point its relative folder from the document root.
I mean: in a file that you include on every file you work on your “mb314” project:
Then you can use your url’s like this
And when you upload your project to the web, you may just change your base_dir variable to:
And that’ll be enough.