Page 1 of 1

Using UNIX paths on a Windows box

PostPosted: 14. December 2006 17:58
by nutkenz
DocumentRoot is 'D:\Webs'

A PHP script requires the bootstrap.php file to be included.

This does not work: require '/Zoek.net/cake/bootstrap.php';
This works fine: require 'D:\Webs\Zoek.net\cake\bootstrap.php';

The problem is that all paths are - and should remain - like '/Zoek.net/cake/bootstrap.php' because the production server is a Linux box. I want to be able to test it on my Windows box without having to change all paths though. Does anyone have a suggestion on how to accomplish this?

The error produced by require '/Zoek.net/cake/bootstrap.php':

Code: Select all
Warning: require(/Zoek.net/cake/bootstrap.php) [function.require]: failed to open stream: No such file or directory in D:\Webs\Zoek.net\public_html\test\index.php on line 81


When I try to enter this include path as a regular URL (http://localhost/Zoek.net/cake/bootstrap.php), the page loads, so it's certain that the path is correct...

PostPosted: 14. December 2006 19:00
by Wiedmann
This does not work: require '/Zoek.net/cake/bootstrap.php';
This works fine: require 'D:\Webs\Zoek.net\cake\bootstrap.php';

The problem is that all paths are - and should remain - like '/Zoek.net/cake/bootstrap.php'

Then you must move your files from "D:\Webs\Zoek.net\" to "D:\Zoek.net\"

PostPosted: 14. December 2006 19:11
by nutkenz
But then they won't even be available for apache because DocumentRoot is 'D:\Webs'... :?