Path issues

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Path issues

Postby chess4us » 06. January 2004 22:57

The number one problem any webmaster faces when he or she decides to run Linux programs in a Windows world seems to be the PATH.

For example: you might be told when setting up a program that you have to change a path to suit your system requirements and you are given an example that looks like this: /usr/www/log

At first you might say to yourself that's not to bad I can do this for example:

c:\xampp\htdocs\log\ and this would be wrong for two reasons.

1) linux likes / instead of \
2) normally linux does not like a trailing /
3) normally linux like a capital C

So the correct way to write the path for the example above would be:

C:/xampp/htdocs/log

You will also notice that in most examples you will see a " at the begining and end " of a path statement. It could be single or double.

"C:/xampp/htdocs/log"


'C:/xampp/htdocs/log'


Question: Does anyone know how to solve the issue of paths once and for all or to put it another way how can we make any program designed to work in a Linux world using (php and apache) work in a windows world.

Here is an example of a problem I am working on right now.


error_reporting("E_ERROR | E_PARSE");
$VERSION = "1.1.0dev";
$_CONFIG = true;

/* paths */
$CFG_JPGRAPH_DIR = "./jpgraph"; I am trying to get the program to see or should I say read this directory with no success so far.

/* Rating Graph */
$CFG_GRAPH_LINE_COLOR = "red";
$CFG_GRAPH_FILL_COLOR = "orange";
/* % Victories Graph */
$CFG_GRAPH_LINE2_COLOR = "black";
$CFG_GRAPH_FILL2_COLOR = "#60A0F0";

$CFG_GRAPH_SHOW = "rating"; /* Values = rating | pv */
$CFG_GRAPH_LIMIT = 100; /* Show graphic from these number of past games. Less number means faster graphics */

Note: this is just a clip!


Do we need a linux emulator or what.. :lol:

Any ways anyone have any ideas...Thanks :twisted:

hahahah
chess4us
 
Posts: 6
Joined: 26. October 2003 18:40

ok

Postby MAGnUm » 15. January 2004 19:09

the most common way i have seen this done so far is to define a easy to change root path such as C:\wampp\htdocs\scriptdir and assign a var to it ($path = "C:\wampp\htdocs\scriptdir\". then build from that like your have images that you use in your web app like /images etc. and depending on the OS force it to use the appropriate dividing mechanism.

if ($os == "win")
{
$path = "C:\wampp\htdocs\scriptdir\"
}
else ...

yeh its a pain in the a$$, but it works.
~~:M A G n U m:~~
(Disclaimer: if any of this info is confusing or vague tough, its free!!)
User avatar
MAGnUm
 
Posts: 151
Joined: 16. October 2003 18:08
Location: USA

Re: ok

Postby chess4us » 17. January 2004 05:00

MAGnUm wrote:the most common way i have seen this done so far is to define a easy to change root path such as C:\wampp\htdocs\scriptdir and assign a var to it ($path = "C:\wampp\htdocs\scriptdir". then build from that like your have images that you use in your web app like /images etc. and depending on the OS force it to use the appropriate dividing mechanism.

if ($os == "win")
{
$path = "C:\wampp\htdocs\scriptdir"
}
else ...

yeh its a pain in the a$$, but it works.


Thanks...that gives me some ideas!
chess4us
 
Posts: 6
Joined: 26. October 2003 18:40


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 103 guests