Re: Differences between PHP on LAMP and PHP on Windows Servers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2012-05-22 at 14:15 -0400, Gates, Jeff wrote:

> Can anyone tell me what differences I might encounter by working with PHP on a Unix server verses working with PHP on a Windows server. We use Windows production servers here but many of us would like to get more LAMP environments.
> 
> So, I'm wondering if I can use the hive mind here to get a sense of the pros and cons of each platform.
> 
> Thanks.
> 
> Jeff
> 


The first difference I'd point out is things like filenames and paths.
*nix systems are case sensitive, so script.php and Script.php are two
totally different files which can happily exist within the same
directory, whereas on a Windows system this isn't true. This can affect
anything from front-end assets (images, CSS, Javascript files, etc) to
PHP includes and even MySQL tables depending on how the database is
configured (it tends to create database files based on the name of the
DB and it's tables)

Also, the path separator is different. Unix/Linux uses a forward slash
and Windows uses a back-slash. While these can be interchanged quite
often without the world imploding, sometimes they just refuse to, so
it's best to ensure you're using the right one for the script. PHP has
several constants defined to help you which change depending on the
system PHP is currently being run on, you can find out more about them
at http://php.net/manual/en/dir.constants.php 

After that, you have file permissions. In Unix, you have file, owner and
group permissions; Windows has read/write permissions and I believe on
newer versions you can get something similar to what Unix/Linux has had
for the last however many years but I'm not 100% sure on that one.

There are differences with setting up PHP to send emails. On Windows I
believe you have to use SMTP, but on Linux you tend to use the internal
sendmail with the choice of SMTP if you wish.

In the main, I'd say that you want your production servers to mirror the
live ones as closely as possible. There have been plenty of times where
I've moved a script to a different machine and things have stopped
working because of a different version of PHP or MySQL was installed,
and you run the risk further if the OS is different too. When you're on
a deadline, the last thing you want is to have to debug something that
you know works just fine!

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux