简体   繁体   中英

Performance differences running PHP under Windows/IIS 7 vs. Linux/Apache?

There is a PHP application right now on a Linux box running under Apache with MySQL. Since we are a windows shop, management wants to get rid of the Linux box and move everything over to windows. Is there a performance difference between the two platforms? Or, is there any significant difference at all, in terms of performance or management?

Microsoft had a team help out optimising PHP for Windows, which work is part of PHP 5.3. Some figures I've seen places the performance close to PHP + Apache on a unix system. Before 5.3 (Which means currently, since 5.3 isn't out yet), performance is bad on Windows. I think there are some patches and tricks you can pull to improve it, but it's going to cost you a bit of performance. That may or may not be a problem; People have a tendency to overestimate performance.

Note that there are other reasons to use unix than just performance. Code may not be portable and even though the core php runs fairly ok, you can well get into trouble with php-extensions and third party libraries. No matter how you look at it, Windows is a second-rate system for running php on.

If your application isn't huge or get hit a couple thousand times per second, there's no difference between the two. LAMP == WAMP in php small projects. Just install something like XAMPP if you want your environment to be as close as possible to your existing one but in Windows.

Good luck with your project!

You should consider the MS WebPI (download at www.microsoft.com/web ) which would install the entire stack for you to run PHP in IIS7 environment.

the performance is comparable for most apps.

I've just done this for the same reason. Mgt wanted to get rid of the Linux box. I was able to completely move my php application and MySQL database. It took longer for me to configure PHP for IIS than it did for me to move the existing content over. I have found though that the IIS server is a fair bit slower when it comes to loading pages and images. Where in Linux it appeared instantaneous, in IIS it takes a half second for the page to load and another second for images.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM