tags:

views:

180

answers:

9

the linux environment is natural to php,

what are the Advantages and disadvantages with run php on windows ?

Are there some limits in windows ?

what is the best (lamp/wamp) in term of performance ?

thanks

+2  A: 

Well, there's the obvious problem of trying to compile PECL extensions on a Windows platform, and the problems associated with not having sendmail running and trying to use the mail function.

Other than that, as long as the source has been ported correctly, it should do fine.

amphetamachine
+1  A: 

I can't give you performance statistics. Would guess that an extremely stripped-down version of Linux or BSD is best from that standpoint.

There are two main disadvantages of Windows. One is that you're likely to have to build some of the lesser-used extensions yourself, if you need them. (There are Windows builds of the common stuff - APC, etc. - available on the net for 32-bit, though. For 64-bit Windows... well, it's a jungle out there.) The other is that you're going to be in the minority, so expect all the things that go hand-in-hand with that. (If you run into configuration difficulty, for example, there will probably be fewer people able to help you.)

The advantage is that (especially if your favorite IDE is something like Visual Studio) you can run all your favorite Windows stuff on the machine. This is really only an advantage if this is, say, a development box - something you're going to use for other purposes as well, not just as a server.

Arkaaito
+1  A: 

If you are working in an windows environment, running your application/php scripts there makes a lot of sense if you want to debug locally.

I wouldn't use WAMP for production environments, because its nature is in linux imho.

XAMPP solves the sendmail issue amphetamachine is talking about by installing mercury mail. It also comes with prebuilt xdebug, apc and memcache modules, which are for me the usual pecl compiled extensions.

Karsten
+4  A: 

It's not so much that it is natural on Linux but the tendency was for developers to use PHP in the earlier days as the ASP on Linux. For years MS never even mentioned PHP and never gave it any support and so most development work happened in the Linux arena with the result that it is more advanced as it has simply had more development hours spent on it.

Again in the early days it was more difficult to get PHP running on ISS but apache makes it easier but then you need to install it. I rarely develop on Windows but i think the environment has changed for the better with more integration.

The emergence of packages such as XAMPP and WAMPP make installation and running a lot easier but as Karsten says not really for the production environment as they are not geared for it in performance and especially on the security level, because of this i also doubt if they are geared for performance, they are geared for ease of install and development.

PurplePilot
+2  A: 

There is an Site from Microsoft for this http://php.iis.net/

For good Performance also check out http://www.iis.net/expand/fastcgi

Andreas Hoffmann
+1  A: 

An obvious problem with PHP on Windows/Apache is not being able to configure PHP APC for current versions of PHP. Hence, no way to create elegant file uploads with progress bar.

naivists
what about the PECL uploadprogress module? could it not be used on windows as well... (does the same thing that APC's upload progress does)
Dan Beam
@Dan Beam - maybe, but I don't see Windows binaries at http://pecl.php.net/package/uploadprogress
naivists
There are definitely unofficial binaries, for example here: http://downloads.php.net/pierre/ - I agree, though, that this is a major nuisance at best.
Arkaaito
couldn't you compile it in?
Dan Beam
+2  A: 

Case sensitivity can be a problem if you develop in Windows and later move to Linux.

Carlos Gutiérrez
+1. This is very true and I can't believe I didn't think of it. (I develop on a WAMP stack for Linux production and test environments. For an example of what he's talking about: one of my images wasn't being rendered on test but showed up just fine on my environment. Turned out that the filename as received was some_image.GIF, I just used it as was, and put some_image.gif in my code... with the result that it showed up fine on Windows systems and not on Linux.)
Arkaaito
+1  A: 

There are many quirks across platforms with PHP, and I don't recommend switching between LAMP / BAMP / SAMP and WAMP / WIMP.

For one thing, permissions are completely different -> usually being a lot harder to work with in Unix/Linux (as Windows doesn't seem to care all that much about permissions as far as I have ever seen). This is a good thing, in my opinion, though (I'm relatively safety paranoid).

Here are a couple more things that differ:

http://php.net/touch (could't change windows directory modified times until 5.3)
http://php.net/flush (still can't flush or ob_flush from some win32 machines)

Both have system specific issues that were just SUPER recently worked out or haven't been fixed yet...

Dan Beam
+1  A: 

Most and main PHP developers (I mean, those that create the language) seem to work under Unix platform. Also, almost all Linux distros take care of building, packing and fixing PHP to suit their systems. And this also applies to auxiliary software like Apache. As a result:

  • There's always some functionality that doesn't work on Windows, e.g. strptime() or has more bugs.
  • Windows binaries are not optimized for your system. You can't even get 64 bit binaries unless you compile them yourself.
  • The MSI installers are not as polished as they should.
  • Installing PECL extensions is very complicate since there aren't official DLLs.

Of course, there's also Windows-only functionality in PHP, such as Windows only extensions or third-party extensions like the Microsoft SQL Server Driver for PHP, or functionality that's way easier to use under Windows, such as ODBC.

Talking about performance itself, it's difficult to make a fair comparison. The operating systems themselves have very different hardware requirements and it'd be misleading to compare optimized Unix builds with generic Windows binaries. My intuition says that the decision of choosing either platform should be based in other considerations, such as budget, required features or ease of maintenance.

Álvaro G. Vicario