Originally posted by adrianuk29
I managed to install php on windows xp. I am very new to this so please excuse my ignorance.
It actually got me thinking as I have never done this before.
Does a php script need to changed for it work on a windows server?
Possibly.
For example on usual php scripts you need to set the path for say uploading a file to a server
$path = "/relative/directory/to/file";
would this need to be different if it was on a windows server?
In this case, maybe not. Microsoft has to conform in the case of URL's .... / instead of \ for example.
The other day on this site, we solved an issues regarding windows shared dirs by changing a path from, BION, \machine\drive\folder to //machine/drive/folder. But it's hard to know exactly ahead of time 😉
Is this why no one offers php on a windows server?
I dunno. I'd guess it's more like
M$= $xxxx
Linux or BSD == $0.00
What are the alternatives to running a server on windows I heard apache is quite good and will it stop the need to changing the path in the scripts?
Are paths the only thing that would need changing in php scripts if they were only designed for linux?
That's a thing that comes to mind. Of course, I also think of system()/shell_exec() and kin. Certainly exec("ping yahoo.com") is no biggie, but $expir=("whois foo.com | grep xpir"); isn't going to work on M$, unless you want your string to read "whois is not recognized blah blah....."
Also, don't confuse the OS with the server software. Apache is an alternative to IIS, etc. Alternatives to Windows are Linux, the BSD's, BeOS, Solaris, HP-UX, etc.
Is it worth struggling with a windows server and php unless I use apache?
Up to you, sir. People are using both all the time. On this forum, for example, there's a lot more traffic on the "Windows Help" than the "Linux/Unix Help" forum. But maybe that's just the OS 😃 😃
Your help is greatly appreciated.
You're welcome 😉