differences in running php scripts on a windows and linux
Moderator: General Moderators
differences in running php scripts on a windows and linux
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]
[/quote][/b]
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
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:
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.
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");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.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
No, mail() does work on Windows because instead of sendmail you can specify a SMTP server for the mail to be sent through.Peter wrote:mail() is non-existant on windows systems.
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.carnivore wrote:I see examples that say a script will work on Linux, does that rule it out altogether from being run on windows??
Mac