Forum Moderators: coopster

Message Too Old, No Replies

Any Quirks moving form PHP/*nix to PHP/Microsoft

         

Philosopher

7:09 pm on Jun 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got a fairly sophisticated link management script that I've written in PHP and only run on *nix boxes. One of my clients is going to be launching a number of new sites over the next few months, but all of them will need to be hosted on Windows based servers due to the coding used for the sites (.net/sql).

I know PHP is fairly cross-platform compatible, but I'm curious of any quirks I might run into when moving. For instance, my script makes heavy use of PHP's mail function, but since I have almost zero experience with windows servers I have no clue if there will be modifications required to get everything to function properly.

Anyone with any experience happen to have any suggestions on what I might need to look at etc?

Thanks in advance.

coopster

7:25 pm on Jun 25, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Hopefully you didn't hard code and path separators, etc. either. Mail is going to be a real fun one for you. I spent a whole day once trying to figure out why an email routine I wrote was not functioning as expected (testing on a Windows installation) only to find out it was the OS. Just make sure you test, test, test it, Philosopher.

Philosopher

7:33 pm on Jun 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I figured I was going to have some fun making the switch. I ran into a mention of a program called fakesendmail which "sounded" like it would be ideal for making an easy transition.

Would go into a bit more depth on what you meant by

Hopefully you didn't hard code and path separators, etc. either

If it's going to be too much of a pain, I may end up creating a subdomain on a *nix host for everything dealing with the script.

Longhaired Genius

7:58 pm on Jun 25, 2005 (gmt 0)

10+ Year Member



I'm pretty sure coopster is referring to the Unix/Windows, forward-slash/backslash difference.

[edited by: Longhaired_Genius at 8:03 pm (utc) on June 25, 2005]

Philosopher

8:00 pm on Jun 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ahh yes, that's right. I'd forgotten about that. That won't be a problem. All referenced server paths are set either by server variables or during installation by the user.

coopster

1:05 pm on Jun 27, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Yes, that is what I was referring to. Another quirky area that differs between servers is the whole CRLF issue. One thing I try to do is keep any functions/features that may differ cross-platform in a separate layer or script. For example, you'll often hear terms like "database abstraction layer" where you can easily modify that one group of functions in the event you have a different database. Also, you can define CONSTANTs in a configuration script, this CRLF is a good example. If you need it to be different for a certain installation, you modify the configuration script.

Sounds like you may have already put something like that in place though, so from here on through it's testing ... good luck moving forward ;-)

Philosopher

6:48 pm on Jun 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it looks like the launch is going to begin next week so I'll begin my testing as soon as the initial hosting accounts are up and ready.

I am curious about what type of cron-type system MS servers have. Currently, a portion of the link management script is run via cron. The general command line looks something like

0 1 * * * path/to/php path/to/my/cronscript.php

I've been digging around but haven't found much reference to automated tasks in MS servers and more specifically, running a php file via automated task.

coopster

12:59 am on Jun 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Look into "Scheduled Tasks". You can get there through the Control Panel.