Page 1 of 1

differences in running php scripts on a windows and linux

Posted: Sun Jun 16, 2002 5:42 pm
by carnivore
What is the differences in running php scripts on a windows and linux server? I have looked at the scripts but really can't and major differences in the script whether it has been writing for a particular server.

[/quote][/b]

Posted: Sun Jun 16, 2002 6:15 pm
by hob_goblin
you can't chmod in windows ;)

Posted: Sun Jun 16, 2002 7:06 pm
by carnivore
I should have made myself clearer. Can a script be writin exclusively for linux that it will fail to work on a windows server, and vise versa?

I see examples that say a script will work on Linux, does that rule it out altogether from being run on windows??

Posted: Mon Jun 17, 2002 12:56 am
by Zmodem
MOST functions and features work on both windows and linux.

There are some subtle differences though. One was mentioned above.

Another one is the use of path names. Such as those used in include().

A lot of scripts writen for linux will do something like this:

Code: Select all

include ("./myfile.php");
That will not work on windows, because of the ./ (dot slash) at the beginning.

However, if the statement were to be written as:

include ("myfile.php");

it would work on BOTH OS's.

In older versions of PHP, sockets didn't work all that well on windows, but did on linux. Also, CC and BCC don't seem to function in the mail() command on windows (at least I couldn't get them to work)

I would say 95% of PHP is totally cross platform.

Hope that helps.

Posted: Mon Jun 17, 2002 1:07 am
by volka
are you trying to write such a script (working on linux but not on windows) deliberately? :cry:

Posted: Mon Jun 17, 2002 2:16 am
by Peter
Sendmail or rather mail() is non-existant on windows systems.

I think most differences are to with the filesystem function and directory functions because obviously Linux and Windows have different filesystems. If not, I'd love to see a C:\windows\ directory on linux OS. :P

Posted: Mon Jun 17, 2002 2:53 am
by volka
mail() is working under php/win32, but you have to set SMTP = <smtp server>

Posted: Mon Jun 17, 2002 2:59 am
by twigletmac
Peter wrote:mail() is non-existant on windows systems.
No, mail() does work on Windows because instead of sendmail you can specify a SMTP server for the mail to be sent through.
carnivore wrote:I see examples that say a script will work on Linux, does that rule it out altogether from being run on windows??
Not necessarily, sometimes it means that the person who wrote the script has only tested it on Linux machines (they know it works on Linux but don't know if it works on Windows) so you may be able to run it on Windows with little or no tweaking.

Mac

Posted: Mon Jun 17, 2002 4:40 am
by mikeq
My developement boxes are windows, but my production box runs some version of Linux.

I have never had to change any code to worl around the different OS's

Thank you

Posted: Mon Jun 17, 2002 2:53 pm
by carnivore
:D Thank you everyone for your help