Using UNIX paths on a Windows box

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
nutkenz
Forum Contributor
Posts: 155
Joined: Tue Jul 19, 2005 12:25 pm

Using UNIX paths on a Windows box

Post 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...
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

The real setting to look at is 'include_path in your php.ini file...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: Using UNIX paths on a Windows box

Post by volka »

nutkenz wrote:This does not work: require '/Zoek.net/cake/bootstrap.php';
This works fine: require 'D:\Webs\Zoek.net\cake\bootstrap.php';
Two very different absolute paths. Where is at least the Webs part in the first path? /Webs/Zoek.net/cake/bootstrap.php
Maybe you need to specify the drive anyway, D:/Webs/Zoek.net/cake/bootstrap.php
Post Reply