Forum Moderators: coopster

Message Too Old, No Replies

Running PHP on windows server

         

adammc

2:47 am on Nov 16, 2007 (gmt 0)

10+ Year Member



Hi Guys,

This might sounds like a stupid question... But, am I able to run PHP scripts on a windows server (windows 2003)?

If so, do I need to modify my existing coding on my scripts that I am currently running on unix?

webdesigner

3:37 am on Nov 16, 2007 (gmt 0)

10+ Year Member



Thats okay, questions are good when your starting out. I am running PHP on Windows XP - so you can run it on Windows. And I don't believe there should be any changes you would need to make to your scripts.

vincevincevince

3:51 am on Nov 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are changes to make if you use IIS; but if you use Apache on the windows server then you will almost certainly be fine.

For a fast setup; use WAMP which will install Apache, MySQL and PHP for you onto your windows server. You'll need to disable/uninstall IIS first.

If you really want to use IIS (and for sites with heavy .net programming it's unavoidable) then you will need to pay attention to $_SERVER variables in particular. $_SERVER[HTTP_HOST] and $_SERVER[REQUEST_URI] are two favourites to break. File handling functions are also likely to break, check them very carefully. Finally, any script using mod_rewrite will be broken. Investigate ISAPI_Rewrite, it is similar.

These changes are just part of the reason why we refuse to deal with windows servers. Just because it runs PHP it doesn't mean it's not going to cause a headache! In the long run it's better to get used to working with linux or other unix-like systems as they are industry standard.

adammc

4:02 am on Nov 16, 2007 (gmt 0)

10+ Year Member



thanks guys, that has eased my mind :)

I have a client who wants a website built but wants to stay with their windows host.

I myself have only ever used unix servers.

vincevincevince

4:24 am on Nov 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



adammc, to hijack the thread a little; it would be interesting to know if the client has a good reason to want to use a windows host for PHP

adammc

5:01 am on Nov 16, 2007 (gmt 0)

10+ Year Member



They need a website re-design and they want to stay with their existing hosting company instead of using my hosting services.

They want me to design their website, I use unix reseller hosting :)