The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

PHP on Windows - how well does it work?

I'm looking at PHP to rewrite my company's shitty e-commerce site, which currently is an ugly mess of Classic ASP spaghetti code.  I think that .NET would be a bit of overkill, although I know more .NET than I do PHP (which won't matter much since I'd probably outsource/contract the site's development).  Also, PHP is closer to ASP Classic than ASP.NET is, while providing real programming capabilities.

Anyways, I know that PHP is 99% of the time incorporated with Linux, Apache et all.  However, our database is SQL Server 2005 and so must run on Windows.  I'm not sure if I can convince them to purchase a separate server to host the site itself (although that would be more secure, too, I suppose) and then set that up with LAP, and I know that PHP *can* run on Windows, but how reliable is it?  Nearly everything I read about it usually says something along the lines of "While you CAN run it on Windows, our advice is to not do it.  Don't go against the grain." and then talks about setting it up on a *nix platform.

Is it that bad?  Or is that just FUD?  I've run some PHP scripts on my laptop with IIS, but a development laptop obviously isn't a live server that routes lots of traffic.
Newbie IT Director
Sunday, December 23, 2007
 
 
Hi, regular ZendCon attender and presenter here...

Actually, according to MS's research about 10% present of users are doing PHP on Windows.  That said, on IIS6/7 there was something like a 40% performance hit.  In addition, the filesystem permissions are fundamentally different, so it's a common area of pain.  Some details - http://www.internetnews.com/dev-news/article.php/3632136

IIS8 has PHP rolled in out of the box, so that's a good thing.  According to some prelim numbers released at ZendCon this year, it sounds like the performance hit is about 20-25% now... and the balance comes down to threading differences between *nix and Windows.

Here are some of the announcements from last year - http://www.eweek.com/article2/0,1759,2047535,00.asp - and some other tech info - http://www.whenpenguinsattack.com/2007/04/06/microsofts-php-initiative/
KC Send private email
Sunday, December 23, 2007
 
 
There is no magic.  If you can't create decent applications in ASP, moving to PHP isn't going to pave over the problem.
Justinian
Sunday, December 23, 2007
 
 
"There is no magic.  If you can't create decent applications in ASP, moving to PHP isn't going to pave over the problem."

The issue is that we didn't write it, and the current solution is very sloppily written (they bought some open source e-commerce suite called Comersus), so I'm evaluating what to use for a rewrite, since Classic ASP is A) A dead platform that won't be supported anymore, and B) Doesn't provide a lot of necessary programming features.  PHP is just an option I'm looking at.
Newbie IT Director
Sunday, December 23, 2007
 
 
We run a pretty big PHP application (SugarCRM) on a Windows server in my office and it works fine, albeit a little slow.

That being said, I would suggest that you reconsider just using ASP.Net. I don't see why you think it's overkill, it's actually going to be much easier for you to get up and running than a PHP application since you will have to install extra modules in IIS to run PHP, something that you wouldn't have to do with ASP.Net.

Furthermore, ASP.Net will provide a high level of integration with Windows as well as SQL Server 2005. If you can get your hands on Visual Studio 2008 you can even use Linq to SQL which is amazing, far beyond anything that you can do with PHP. Besides that, you already know a .Net language and you will be much more productive with that.
Wayne Bloss Send private email
Sunday, December 23, 2007
 
 
I never think about rewriting in another language just to clean-up the spaghetti code.

If you know classic ASP, just untangle the mess.
Totally Agreeing
Sunday, December 23, 2007
 
 
Getting PHP to run on Windows shouldn't be a problem. Part of the reason why most developers will recommend against it,  is that unix and apache are superior platforms, compared to windows and iis. With PHP, you actually have the option, to get a rolls royce for free -- So why settle with Windows?
If you want to use PHP and you want to use Windows, just go ahead.

That all said, why don't you find the developers first. Then pick whatever language they are experienced with. The technical platform doesn't really matter that much.
Troels Knak-Nielsen Send private email
Sunday, December 23, 2007
 
 
I have not had any problems running PHP on Windows, I don't think there is any reason to expect it to run worse or better than anywhere else.

But the nice thing about running PHP is all the existing packages out there already doing stuff.

If you're only going to do completely custom development, ASP.net is definitely better integrated with IIS for stuff like debugging support, etc...
Michael G
Sunday, December 23, 2007
 
 
We have had positive experience with running PHP on Windows/IIS. In fact our product has been initially written as standalone application running PHP/IIS/ODBC-Access then ported to Linux/PHP/Apache/MySQL. We never had any reliability issues running under Windows (neither under Linux of course). On the other side it is a very low load application so I do not know if things may get ugly when you have high traffic and load.

There are things to watch out for when writing PHP scripts under Windows like inability to store dates prior to 1970 in PHP version before 5.1.0, etc. Just read the PHP manual for the functions that you use carefully. It will usually contain notes on Windows if there are any issues.
TN Send private email
Monday, December 24, 2007
 
 
> Classic ASP is A) A dead platform that won't be
> supported anymore...

You might want to tell Microsoft.  IIS 7.0 supports ASP just fine.  It was even updated to use IIS 7's new modular pipeline API, just as ASP.Net is now too.

Where do these misconceptions come from?
Codger
Monday, December 24, 2007
 
 
Maybe from people with an agenda trying to convince management to throw out existing code and support a full rewrite using a pet system?
Justinian
Monday, December 24, 2007
 
 
PHP is multiplatform though, which gives it an obvious edge.
Codger
Monday, December 24, 2007
 
 
"Where do these misconceptions come from?"

Maybe the fact that all new MS stuff deals with ASP.NET, and Classic ASP hasn't been updated in a long time?  That screams "dead" to me.

In any event, the issue I'm facing is that the current system does not work at all, it's very buggy, and the code and data is convoluted because the original developer seemingly had no clue what he was doing, but hacked together something that sort of works.  PHP was an option to consider (although I'm now looking at reevaluating ASP.NET) to make a robust system, not a mishmash of garbage held together by string and wire.
Newbie IT Director
Monday, December 24, 2007
 
 
Might I suggest considering virtualization as an option.  Eve you decipe php is the best dev platform for this particular application, and are afraid of running it on windows, just create a *nix vm with a LAMP install to run.  Server virtualization is becoming more and more common and supported for enterprise environments.
I dont use my real name on the web
Monday, December 24, 2007
 
 
Using Virtualization to run in production a web stack one has ZERO familiarity (I am not saying the OP is in that situation, but if he/she were) would be disasterous for the data being served from that web stack from a security, scalability, and few more cans of worms' perspective. Just how it is.
Li-fan Chen Send private email
Monday, December 24, 2007
 
 
Newbie IT Director you are shopping around for a new web stack using a FUD meter and features checklists for due diligence.... This is not going to bode well for your next shopping cart. Why can't your developers evaluate the next shopping cart, are you involved in maintaining the backend code in a primary role?
Li-fan Chen Send private email
Monday, December 24, 2007
 
 
If ASP.NET is what your shop was originally good at, another cart (I haven't used it, for all I know it could be even worse than what you use) is aspdotnetstorefront.com.

There are quite a few DOTNET carts before you have to resort to PHP carts (especially if your team is ASPNET oriented or most experienced with the windows stack)
Li-fan Chen Send private email
Monday, December 24, 2007
 
 
If you can swap in/out teams at whim to fit your technology choice then please kindly discount some of the things I said about team familiarity. Also discount for what I said if you aren't really touching the code in any way.
Li-fan Chen Send private email
Monday, December 24, 2007
 
 
"With PHP, you actually have the option, to get a rolls royce for free -- So why settle with Windows?"

Pffft. Rolls royce? More like a rebuilt Volkswagen Thing slapped together with spare parts.
Wayne Bloss Send private email
Monday, December 24, 2007
 
 
It is a small company, I *am* the IT department, so it can be whatever I decide, although I will probably look to contract some of the work out and then act as Project Manager, as I'm only a mediocre programmer myself and it's a large, complex project.

The "programmer" (and I use the term loosely) working here before I was hired on took an open-source commercial shopping cart called Comersus and did some minor tweaks to it, but largely the code is ugly spaghetti that's a nightmare to maintain (this is the actual Comersus code, this isn't something he whipped up himself), so my boss (the COO) has asked me to look into ways to improve it.  I dug around through the code (as well as having to do some bug fixes) and I've come to the conclusion that the best way to 'fix' it is to rewrite it from scratch, since the Comersus code is really that bad.  I'm not 100% sure if I wanted to move to ASP.NET (although I have experience working with that myself) or look at alternative solutions.

I am very leery of using an existing framework due to the bad taste this Comersus application has left in my mouth.  Our data was shoehorned to fit with the Comersus model, instead of the other way around (presumably because the consultant didn't know how, or maybe he was just lazy), and I don't want to go down that road again.  While our business isn't unique, we have some unique situations that require a fair bit of customization:  For one, we have about four different pricing schemas depending on what "group" our customer belongs to, and we need to be able to update/modify this on a fairly regular basis (one of which is for Amazon, and is updated usually once every two weeks to ensure that we stay competitive and in the top ranking).  There is also another company in the same line of business as us that we take care of the processing for, and their data has to be kept separate from our own.  This has led the current system to basically having two copies of the exact same data (one for each company) with two separate Classic ASP applications (again, part of this Comersus suite) that contain the exact same code, as our employees can access either one to perform administrative tasks.

This is the main reason I'm loathe to look at prepackaged solutions; for fear of ending up with a similar solution to what we have now - a house of straw held up with glue due to trying to fit our data around a prepackaged solution.
Newbie IT Director
Monday, December 24, 2007
 
 
Far as I know, frankly I only know Commerce Server, the closest one can get to "a bunch of helper libraries and resources that aid you in building a decent ecommerce site" is well Commerce Server. It's making its way from VBscript/ASP era to .NET since last I looked at it. It's pricy but you might be so happy with what it is doing and the money saved that you might go for it anyway. Companies like Starbucks uses Commerce Server. It does has starter packs of reference estops you can just customize and use, but that's not the only way to start. But I would have to say that such an enterprisy solution might cause you to spend a whole lot more in the HR dept.
Li-fan Chen Send private email
Tuesday, December 25, 2007
 
 
@Wayne Bloss
I take it, your "Pffft" is directed at PHP? If you read my post, the Rolls Royce, I was talking about, was the operating system and web server. "Pffft"'ing at *nix+apache is probably not what you meant to do ...

Anyway. I don't think PHP deserves all the bad press it gets. It can be quite reasonable choice.
Troels Knak-Nielsen Send private email
Tuesday, December 25, 2007
 
 
No, my feeling was directed at the idea that you think that PHP + *nix + Apache is superior to C# + Windows + IIS. The former are indeed slapped together from spare parts where as the latter are built for each other. That's not to say that Apache/*nix isn't slightly faster than IIS/Windows, but raw speed ain't everything.

Besides the fact that IIS had less security issues than Apache these last few years while maintaining comparable speed and scalability, you get an amazing set of easy to use APIs. What can you do with Apache? J2EE or PHP with MySQL or Postgres? Rails? No thank you. Yuck. You get what you pay for and you'll spend quite a bit more time configuring that mess than I will configuring IIS/Windows/SQL Server.
Wayne Bloss Send private email
Wednesday, December 26, 2007
 
 
Actually Wayne Apache is very much made for UN*X-like systems. Having read through the whole source base of 1.3 I don't see why someone could find something as well designed as a daemon.

Regarding Wayne's comment: "The former are indeed slapped together from spare parts where as the latter are built for each other."

UN*X, TCP/IP, demands a certain type of design, and Apache is the result of those years of discovery of what the best patterns are. It does exactly what's right plus it pushes IETF forward.

Who cares about how well coupled IIS + C# + Windows is--if all people does is use it in the worse possible way?

Say using it for .NET's WS-*?
Li-fan Chen Send private email
Wednesday, December 26, 2007
 
 
Thank you Wayne for your bit of wisdom.  That must be why the likes of Google and Yahoo use IIS ...
WTF
Wednesday, December 26, 2007
 
 
Actually, WTF...Google doesn't run Apache, they run GWS. Go check netcraft. Yahoo runs Apache. Whipdeedoo! Ebay runs on IIS, so do Myspace, Dell.com and of course all of Microsoft's sites. According to the Netcraft market share survey, IIS: 37%, Apache 47%.

http://news.netcraft.com/archives/web_server_survey.html

What does this mean to the average coder? Pick the one that gives you the best productivity tools maybe?
Wayne Bloss Send private email
Thursday, December 27, 2007
 
 
"You get what you pay for and you'll spend quite a bit more time configuring that mess than I will configuring IIS/Windows/SQL Server."

Spoken like someone who's never tried.  Both platforms have their advantages and disadvantages based on the situation.  In this case, the safer choice is probably moving to ASP.NET rather than PHP.

I've got a bunch of Linux servers and a few Windows servers and by far the Linux servers are easier to configure (when you have the appropriate tools) and require much less maintenance.  As for productivity tools, there isn't a hell of a lot of difference.  I have tools for both and I'm equally productive in both.

I run PHP on Windows for development purposes (on Apache for Windows) but I wouldn't go that route for production.  If all you've got (or want) is Windows, then use IIS and go with an all Microsoft solution.
Almost H. Anonymous Send private email
Thursday, December 27, 2007
 
 
"No, my feeling was directed at the idea that you think that PHP + *nix + Apache is superior to C# + Windows + IIS. The former are indeed slapped together from spare parts where as the latter are built for each other."

I prefer high cohesion and low coupling. There's definitely some advantage to a tightly coupled stack, but the benefit of something put together from spare parts, as you put it, is that you can easily change any one of those parts, if you need to.
Troels Knak-Nielsen Send private email
Thursday, December 27, 2007
 
 
Thank you for the replies, everyone.  Given our current situation it does seem like ASP.NET would be the better upgrade route than PHP, given that I have only limited experience playing with Linux and Apache, and even then it's been for development not production so I do it the 'easy' way (i.e. I use the package managers to get a quick setup, I don't play with the source to optimize it).

At the moment I'm looking into suggesting an open-source and Linux solution to management since we're evaluating licensing options from Microsoft; if we decide to go that route then I'll re-evaluate PHP as a platform (as well as other things such as Java/JSP).  If we stick with Microsoft, then I'll more than likely use ASP.NET (which, as I said, I have the most experience with at any rate).

Thanks again for the help.
Newbie IT Director
Thursday, December 27, 2007
 
 
We are slowly converting our web sites from ASP to PHP. PHP on Windows works just fine, and I have not notice any major problems. That being said, our web site does not have huge traffic.
The problem with ASP is extensibility. ASP does not have a large functionality set built-in like PHP. On the other side, ASP.NET uses a competely different model and a major rewrite is required.
Glitch
Thursday, December 27, 2007
 
 
We are using ASP.NET are quite often experiencing weird IIS performance issues. Sometimes it takes forever to serve up simple static content.

I feel that the LAMP stack is more predictable. It either works or doesn't.

That said, C# is a nice language and .NET a great platform.
fritz melchior Send private email
Thursday, December 27, 2007
 
 
I'm glad that the OP got it figured out despite the inevitable holy war erupting into this thread =D

Sorry, I just can't seem to keep my mouth shut when someone says "X is clearly superior to Y" when that is clearly not the case. So, I have to go to extremes sometimes to prove my point.

I don't really think that LAMP is a pile of crap and I REALLY don't think that Windows/IIS/SQL Server/C# (WISC?) is better than LAMP in all situations. I do think that the development tools that you get with the WISC stack are superior in terms of productivity, but if the end result doesn't scale as easily as you'd like, then it doesn't even matter.

To the person who said "Spoken like someone who has never tried": I have setup Apache quite a few times. I even know a good bit of PHP! The only tools that I have ever used to configure Apache are the conf and htaccess files. I have never found a tool that allowed me to do everything that you can do with those files.
Wayne Bloss Send private email
Thursday, December 27, 2007
 
 
Re: Reliability of PHP on Windows - The web site of a department store in the UK was hacked within the last 2 months.  They were running PHP 4.3.10.  The initial break-in  could have come from a stolen admin password.

  The real problem was after the hackers installed their mass spam scripts, bot networks and cranked all that up in addition to the store e-Commerce site.    IIS / PHP produced some inane error like "PHP fatal memory error 73838111" ( I don't have the exact error any more).  The entire site was dead until IIS could be restarted.

  A Google search for that error showed a bunch of blowoff replies that the developers didn't believe that the Win32 PHP ISAPI plugin was ultra-reliable.  The error also showed up on PHP5 installations according to the Google search.

  Moral of the story?  I wouldn't trust a critical e-commerce site to Windows-PHP until the dev community blesses the ISAPI plugin, or MS includes PHP with IIS8.
Crimefighter
Tuesday, January 01, 2008
 
 
"Ebay runs on IIS"

Wrong. Its J2EE.

They kept the old extensions just like myspace uses its old coldfusion extensions even though its .net.
SmartYoungAnonPoster Send private email
Wednesday, January 02, 2008
 
 
"The only tools that I have ever used to configure Apache are the conf and htaccess files. I have never found a tool that allowed me to do everything that you can do with those files."

What happened to your notepad.exe?
Berislav Lopac Send private email
Saturday, January 12, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz