Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

PHP Optimized for Windows Server 2008

Posted by Zonk on Tue Mar 04, 2008 11:22 AM
from the dogs-and-cats-living-together dept.
Stony Stevenson writes "It used to be that popular PHP applications would run more poorly on Windows Server than on a Linux or Unix servers, for which PHP had been optimized. Specialist in the PHP language Zend Technologies now says that's no longer the case. The Zend Core commercially supported form of PHP has been certified by Microsoft as ready to run 'with performance and stability' on Windows Server 2008, said Andi Gutmans, co-founder and CTO of Zend. Previously, PHP 'didn't run as well as it should on Windows,' said Gutmans, despite the fact that 75% to 80% of PHP users were developing on Windows workstations."
+ -
story

Related Stories

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • In Short (Score:5, Insightful)

    by TheRealMindChild (743925) on Tuesday March 04 2008, @11:29AM (#22636724) Homepage Journal
    So, in short, they aren't using cygwin anymore to compile it.
  • by Foofoobar (318279) on Tuesday March 04 2008, @11:30AM (#22636736)
    As a CGI you still have to make extra system calls that you don't have to make as an apache module. Running under FastCGI is a good first step but it still doesn't make it as fast as running it as an Apache Module. In a recent post on Slashdot about how Microsoft is learning from open source, they claim they made IIS more modular like Apache but this is not the case as PHP proves otherwise they could run it as a module.

    I applaud the effort to embrace open source languages though and hope they continue along this path of self improvement.

    • Re: (Score:3, Interesting)

      Furthermore, FastCGI under IIS (haven't tried with anything newer than 2003r2/IIS6) isn't fully compatible with at least one popular application that I can think of.

      http://wordpress.org/support/topic/150672 [wordpress.org]

      -theGreater's $0.02.
    • by arodland (127775) on Tuesday March 04 2008, @11:45AM (#22636944)
      In my testing (Perl, not PHP, but I don't think it particularly matters here), a "real world app" ran 98% as fast under FastCGI as under mod_perl -- and FastCGI is easier to deploy, easier to maintain, and (in the simple case) better on memory. Is it really worth chasing that extra 2%?

      Of course, in the case of PHP, there's an extra incentive. I don't trust PHP's security or sanity for shit. So I'd much rather have it running in its own process with its own permissions than have it dynamically linked directly into my webserver :)
      • Re: (Score:3, Insightful)

        PHP's security isn't so much a problem compared to non-security-conscious developers working with it since it's so damn easy to pick up. If you're running stuff like $query="INSERT INTO `users` (`name`) VALUES '${_GET['name']}';";, it really doesn't matter what language you're using.
        • Very true. I once inherited a Ruby on Rails project that had code similar to this:

          @variable = eval("@#{params[:variable]}")
          I think I'd rather see SQL injection vulnerabilities.
        • Re: (Score:3, Informative)

          If you're running stuff like $query="INSERT INTO `users` (`name`) VALUES '${_GET['name']}';";, it really doesn't matter what language you're using.

          But a language which uses this kind of thing, rather than a printf analogue with encoded type information is much more likely to encourage this kind of code. The PostgreSQL C interface contains a printf-like function which doesn't include the arguments in the SQL string at all, it puts pointers to arguments and the arguments themselves in the packet sent to the server so there is no escaping ever required because string arguments never go through the SQL parser. The same is true of most databases, and ye

      • Yeah but thats mod_perl. mod_perl has been known to suck. The recommended way from Zend and Apache for PHP has always been as an apache module. Also to get alot of the added benefits like virtual hosting and stuff, you need to upgrade and the upgrade costs. For that you may as well stick with the apache module.
    • Re: (Score:3, Interesting)

      PHP used to also ship as an ISAPI module, but it did pretty much the same thing that the CGI did- reload the interpreter for every single request. I'm not sure why they bothered with FastCGI when it would've required about the same amount of effort to write an ISAPI extension. It might have to do with the fact that PHP's source code was more spaghetti-like than any PHP code one could dream up, and not trivial to follow or modify.

      It would be interesting to compare the performance to that of Python [insert
      • Re: (Score:3, Informative)

        PHP's issues with ISAPI are due to it not being thread-safe. We've tried to deploy PHP as ISAPI on windows, and things run fine until the customer starts using an application module that uses GD, or some other non-thread-safe extension, and then you get sporadic crashes that come more often as the load increases (which is obviously the worst time for a server crash).

        FastCGI's benefit is that every FastCGI handler is still a separate process, so you don't run into threading issues, while at the same time not
  • Light on details (Score:2, Insightful)

    by Anonymous Coward
    It would have been nice to know the areas that they optimized to get the performance increases. Unfortunately the article is a little light on the details.
  • by Freexe (717562) <serrkr@tznvy.pbz> on Tuesday March 04 2008, @11:31AM (#22636754) Homepage
    There are still many other compatibility issues between PHP on Windows and Linux that make it hard to push things from a Windows box straight to a Linux box without extra testing.
      • It really makes me wonder, why on earth developers don't all switch to the mac? Price is definitely not an excuse anymore, and compatibility issues are tales from ages ago.

        Because the Mac is an irksome piece of shit with a bad UI and uninteresting hardware.
  • Misleading (Score:5, Insightful)

    by MojoRilla (591502) on Tuesday March 04 2008, @11:32AM (#22636758)
    This is misleading.

    75% to 80% of PHP users were developing on Windows workstations.
    And how many of these applications are being deployed on Windows? Probably not that many. Windows isn't a great server operating system.
    • Re:Misleading (Score:5, Insightful)

      by liquidpele (663430) on Tuesday March 04 2008, @11:37AM (#22636840) Homepage Journal
      exactly. I develop php apps on windows, have dreamweaver upload them to Linux, and then test it out through my browser. Saying most people develop a web application on OS XYZ is like saying 95% of people prepare their food in the kitchen while implying that is where they also eat it.
    • It's not as bad as you make out. And with IIS7, it now makes a good web server, too.
    • Re: (Score:2, Insightful)

      Windows isn't a great server operating system.

      Not for PHP applications, no. Good enough for light testing, but not production.

      .NET-based applications on the other hand, work great. Server 2003 and 2008 now are great platforms for them. So when you say "isn't a great server", I expect you mean "for the language/technology I choose to work for", much as Mono-based apps are not exactly mainstream or very well tested in Apache.

    • Re:Misleading (Score:5, Informative)

      by Santana (103744) on Tuesday March 04 2008, @12:03PM (#22637222) Homepage

      This is misleading.

      Only if you have problems reading English. That sentence clearly speaks about development, not deployment.

      • Re: (Score:3, Insightful)

        actually, it is misleading. it does not have any reasonable connection with the fact itself/article.
        well, unless those developers run windows 2008 server on their workstations.
      • Re: (Score:3, Insightful)

        This is misleading.

        Only if you have problems reading English. That sentence clearly speaks about development, not deployment.

        No, he was right on the mark. You are correct that the sentence clearly says development. But the point is that mentioning development in this context is misleading. It doesn't matter where code is written, it matters where the code is run, if you are talking about the performance of the code. TFA is misleading in that respect. It seems their point has an underlying assumption that development and production should be on the same OS or something like that; under that assumption the quote makes sense. It's

    • Re: (Score:2, Informative)

      That is exactly the point. There are very few Windows deployments because PHP on Windows was 2-3 times slower than on Linux and unstable before we made the said improvements in PHP and Microsoft built FastCGI support into IIS 7.
    • If you work for the military and build web-apps, you don't get a choice between the two. (And it isn't Linux.)

      Frankly, I was pleasantly surprised they even had PHP configured on their boxes at all (I thought it was only ASP at first). And a pretty up-to-date version as well.
    • Re:Misleading (Score:5, Insightful)

      by jsebrech (525647) on Tuesday March 04 2008, @01:50PM (#22639472)
      And how many of these applications are being deployed on Windows?

      My company's PHP based software runs over 95 percent on IIS servers. We have a single customer that uses linux for their web server platform (a university). We're talking about big customers here, like Siemens and ISS (one of the world's largest cleaning firms), with dozens of servers each running our platform, all of them Windows servers.

      We've been deploying PHP on fastcgi the whole time. ISAPI has never been stable, and CGI has always been too slow.

      Tthe situation changes for non-intranet web apps. Those tend to be linux-hosted because people tend to outsource their hosting. But for in-house hosted software, most of the time you have to fall back on the existing network team, who is usually specialized in windows, so they tend to prefer windows-based web servers, even if it's just for the sake of uniformity.

  • by dedazo (737510) on Tuesday March 04 2008, @11:34AM (#22636778) Journal
    PHP on IIS5/6 had to run as a CGI application, because their ISAPI handler implementation was historically crappy and unstable under load. CGI under the thread-oriented (as opposed to process-oriented in *nix) pipelining model of Windows was usually not a good performer. IIS7 introduced FastCGI, which is what Zend used to "certify" PHP to run on Server 2008. But FastCGI is not an optimization, it's a new execution mode for IIS. Nor was PHP modified (AFAIK) in any way to run effectively on FastCGI. Python apps also run very well on it (which personally is more exciting to me than PHP).
    • I like FastCGI because it's cleaner than stuff like mod_perl (and seems more robust too).

      It's like CGI in that you can write FastCGI apps in all sorts of different languages, and they are more portable across different webservers (if they support fastcgi and you can figure out how to turn it on).

      Years ago I tested my FastCGI perl apps which were on Apache on a Zeus webserver and they worked fine (can't recall if they worked faster, they might have :) ). Unless Microsoft has been naughty again, they'd probab
  • Marketing (Score:3, Interesting)

    by LingNoi (1066278) on Tuesday March 04 2008, @11:35AM (#22636810)
    Meh, I wouldn't believe Zend. They're in corporation with Microsoft to provide better interoperability... They're not going to go into a deal with Microsoft and then say, "Still sucks on Windows server" are they?

    Surely it should also run better on all windows servers so why just 2008? Unless they're trying to find reasons for you to upgrade..
  • PHP on Windows (Score:5, Insightful)

    by corychristison (951993) on Tuesday March 04 2008, @11:42AM (#22636906)
    ... like Ruby on Rails?

    Just kidding. Seriously, though, it said "commercially supported form of PHP". Be sure to take a big mental note of that.
    Commercial == fee's. Based on Zends track record of charging for things, it's not going to be cheap for single developers... I have a feeling it'll be in the area of $800-$1500 per CPU or something silly like that [zend.com]... in which case, why not just use a UNIX/derivative?
  • Why not Apache? (Score:5, Insightful)

    by edmicman (830206) on Tuesday March 04 2008, @11:47AM (#22636974) Homepage Journal
    We run a .NET shop here, but even I wonder, why not just install Apache on Windows? Errrrr, or why not just go the easy route and put up an Ubuntu LAMP server? Everything I work on is in Windows, but I just don't see the benefit of running PHP on Windows...what does [Microsoft say] the Windows platform offers for PHP that running it on freely available platforms doesn't?
    • If they install apache then MS can't try to lock them into using windows for the server, duh.
    • Because if you have a Windows domain fully configured in a large corporation, integrating IIS with all that is a snap. Actually, it most likely -already- is: Reporting Services, Sharepoint, Exchange, they all use it.

      So my question is: Why use 2 web servers when you can use only one, especially one thats already installed and locked down?
      • by RipSUp (987194) on Tuesday March 04 2008, @12:11PM (#22637398)
        They don't want your LAMP to become a WAMP, they want it to become a WIMP (Windows/IIS/MSSQL/PHP)
        • Re: (Score:3, Interesting)

          Agreed.

          In 2004-05, I wrote a PHP application for a client. We had agreed ahead of time that the app would be written in PHP. Upon delivery, everything worked great on the test (WIMP) server that I set up myself. When the technician was called in to put the application in production, he said no problem. I should point out that the fellow is a hard-core and experienced MCSE.

          A month later, the application was not installed. I called the technician to find out what was happening, and I was given the story of be
      • by jjrockman (802957) on Tuesday March 04 2008, @12:11PM (#22637400) Homepage
        Don't you mean Windows IIS MySQL PHP/Perl? Or, WIMP for short.
        • Re: (Score:3, Informative)

          Don't you mean Windows IIS MySQL PHP/Perl? Or, WIMP for short.
          Not quite - MSSQL, not MySQL!
      • And for Zend, it opens up shops that are exclusively IIS and might have banned PHP in the past for performance reasons.
  • Hmm (Score:2, Flamebait)

    Here's an idea: try making slashvertisements less obvious.
  • Anybody think the real agenda here is for Zend to better monetize PHP? I don't know the numbers but my working assumptions are: some big % of web sites use PHP, the vast majority of them are not doing it on Windows, & the vast majority aren't paying Zend anything nor are they going to be receptive to any sort of costs being imposed on them.

    On the other hand, if there's a market segment used to paying somebody for their software, and paying every year to keep it running, wouldn't that be a great market

    • Re:another prese (Score:4, Informative)

      by PHPfanboy (841183) on Tuesday March 04 2008, @04:50PM (#22642618)
      Zend is the PHP Company. I don't think it's any great secret that their aim is to monetize PHP. I'm not sure there's anything inherently wrong with that. Plenty of other companies and individuals monetize PHP by providing software, consulting, hosting and other services around PHP If there's value-add provided, companies will pay.

      You're probably perfectly aware that there are a large section of Linux using shops who are perfectly happy to pay, hence the success of RHEL and to a lesser extent SuSE and now Ubuntu all of which offer support around free stuff.

      The fact that Zend has worked with IBM on PHP for i5 (AS400) and with Microsoft for decent PHP on Windows only increases the choice of platforms PHP developers have to deploy on, makes PHP projects more popular across other user bases and means that PHP developers have a wider range of employment opportunities available to them. I don't think anyone is under the illusion that the future of PHP development is at 6 person consultancies who specialize in tweaking free CMSs, surviving on that free good stuff and creating pure karma (with no disrespect to small web consultancies intended, but it's a limited niche to attract new active members to the community).

      If you'd like to spend your time pitching PHP as a strategic application development option to Fortune 500 companies, government departments and other enterprises, I'm sure we'd all be delighted, but there's not much chance of you spending your time doing that, nor quite frankly of those entities listening to you. They do however talk to Zend.

      Zend isn't imposing a cost/tax on anybody or demanding that people pay homage/tribute, especially as PHP is a community project and not owned by Zend. During the past 2 years Zend has increased the amount of free and open source work they've done (Zend Framework and the Eclipse-based PDT) so it's not like they take and don't give.

      If there is value companies can get from Zend's solution set, then they will pay for it. And they do. It's simple cost-benefit equations. WRT your "siphoning off revenue" if you look at all the companies in the Open Source space (including MySQL, EZ Publish, Acquia and other) they all provide value adds.

      And yeah, I work for Zend. And no, you don't have to buy our stuff (but at least come check it out). And no the decision to monetize PHP wasn't made by executives on the fringe of the FOSS world, but rather technology people in the middle of it. (I have no idea whether they have hair up their asses like you claim - but can gladly inform you that that's not a sound basis for a business strategy unless you're a barber looking for a niche....)
  • by 200_success (623160) on Tuesday March 04 2008, @02:45PM (#22640544)
    PHP and Windows? They each suck enough on their own.
    • Re: (Score:2, Interesting)

      You mean there's a difference between Windows as a workstation and Windows as a server beyond price? Oh, and the crippling of a couple of services?

      Maybe I should become one of the 75% to 80% of PHP developers who use this 'Windows' thing and see the difference myself.
    • Not if you speak the Queen's English, it isn't. Spelling it with a "Z" is American.
            • Re: (Score:3, Informative)

              I didn't mean to say American English has no rules. Only that English English has more, and that they are less logical and harder to remember. You're picking a grammar fight when I don't have Fowler's to hand, but from memory;

              Singular with an s-ending takes word+'s
              Plural without an s-ending takes word+'s
              Plural with an s-ending takes word+es'
              The United Nations (and other singular entities with plural names) takes word+'s

              Between this and contraction forms, it's pretty obvious why apostrophes are dyin