Is Apache 2.0 Worth the Switch for PHP? 465
An anonymous reader writes "It seems like some of the members of the Apache Software Foundation are a little angry with the PHP Community because they don't recommend using Apache 2.0 with PHP. Since PHP is installed on half of all Apache servers this is a major issue for them. A number of high-profile PHP community members such as John Coggeshall and Chris Shiflett have blogged about this decision in light of a recent posting by Apache Software Foundation Member Rich Bowen which called PHP's anti-Apache2 stance FUD. Is there any real reason for the PHP community to start recommending Apache 2.0, especially when the 1.3.x series of Apache is rock solid and proven? Note Rich did later commend PHP for being a great product, so it's not all flames."
PHP used to be an ASF project (Score:5, Interesting)
I should probably be noted that PHP used to be an official Apache Software Foundation project until it was mutually agreed to end this relationship. I have no clue as to what the underlying reasons were and as an ASF member myself would rather not speculate on this. See ASF Board Meeting Minutes [apache.org] for Feb 2004 (section 5.G).
P.S. Apache 2.0 is great and there is no reason not to use it IMO.
Re:PHP used to be an ASF project (Score:5, Informative)
Re:PHP used to be an ASF project (Score:3, Informative)
S
Re:PHP used to be an ASF project (Score:5, Insightful)
Although on the surface that sounds pretty neutral, I can certainly understand Apache being concerned about this, considering how closely affiliated the two are (as the grandparent noted). I like analogies so imagine bringing home a couple of girlfriends over the years for Mom and Dad to meet. Then you meet an even better girl whom you invest a lot of effort into impressing and you're sure they'll love her, but instead they say, "what was wrong with your last girlfriend?" While your parents haven't said anything against your new lady friend, they've implied they're not impressed. I admit, dating is a poor analogy for some of the regulars here, but at least it was fun while lasted, right?
I agree that it sounds somewhat petty. Why not say something a little more friendly like, "We've seen great things from the Apache Foundation, and while we're not prepared to fully endorse version 2, we're anxious to see how it performs?" It's simple, generic, non-committal, open-ended, political-style BS, but it keeps people happy.
Re:PHP used to be an ASF project (Score:5, Informative)
Re:PHP used to be an ASF project (Score:5, Informative)
In other words it's PHP at fault and not apache2 and they are admitting it.
this is untrue. (Score:5, Informative)
Do not use Apache 2.0.x and PHP in a production environment neither on Unix nor on Windows.
Re:PHP used to be an ASF project (Score:5, Funny)
Hello, pot? This is kettle ...
Re:PHP used to be an ASF project (Score:3, Funny)
Re:PHP used to be an ASF project (Score:4, Interesting)
For instance, i am unable to upgrade my server to php5 because many customer code won't run correctly on it.. But before too long, we will have customers demanding php5 because their code doesn't work on 4..
apache2 is essential for Windows (Score:3, Informative)
Apache2 works way better on Windows.
Re:apache2 is essential for Windows (Score:5, Funny)
Anyone still running Windows is nuts
Re:apache2 is essential for Windows (Score:2)
How much longer can we keep this joke going?
Re:apache2 is essential for Windows (Score:5, Funny)
Anyone who wants to keep this joke going is nuts.
Re:apache2 is essential for Windows (Score:3, Funny)
OT: Great sig (Score:5, Funny)
Great sig!
The good thing about Christianity is that the DM is much, much better. Or at least more consistent.
The bad thing is that He can't be bought off with a six-pack of Dew and a pizza.
The good thing about D&D is that the DM is usually your friend and will try to make it so you have fun.
The bad thing is that the DM can give you millions of gold pieces, +8 everything and make you king of world or even a god, but you still gotta go to work/class on Monday morning.
Re:apache2 is essential for Windows (Score:3, Funny)
Re:apache2 is essential for Windows (Score:3, Funny)
Re:apache2 is essential for Windows (Score:3, Funny)
Re:apache2 is essential for Windows (Score:3, Funny)
Re:apache2 is essential for Windows (Score:3, Funny)
Not up to us ... (Score:4, Funny)
Talk to Microsoft, it's them what's keeping the joke going.
Re:apache2 is essential for Windows (Score:4, Informative)
Re:apache2 is essential for Windows (Score:4, Interesting)
It all goes back to Windows NT being designed from the beginning to enourage the use of threads, while Unix always favored multiple processes.
Re:apache2 is essential for Windows (Score:3, Informative)
On NT, instead of creating 64* threads [apache.org] (or whatever the maximum number of concurrent clients will be, possibly hundreds) where one thread waits on each connected client, it would be better to create about 1 thread per CPU and have them take work items off of a completion port [microsoft.com]. Instead of blocki
Re:apache2 is essential for Windows (Score:3, Insightful)
Re:apache2 is essential for Windows (Score:3, Funny)
FUD in it's purest form ... (Score:5, Informative)
Re:FUD in it's purest form ... (Score:3, Interesting)
Re:FUD in it's purest form ... (Score:3, Interesting)
Bruce
Re:FUD in it's purest form ... (Score:5, Interesting)
As for putting a lock around them, I'd imagine that when that happens, it would be considered thread safe *except*...
PHP has a user contributed library system similar to CPAN called PEAR. Some of the libraries in PEAR aren't threadsafe... and even if somebody went through and updated them, next week there will be several new one that are not threadsafe.
Now, all of this would be moot if there were a compelling reason to push to Apache2. The impetus would be there to do the work. But, right now, the last of the 1.x series is just as stable and performs as well as Apache2. That means that there's simply no reason to do the work, and Open Source doesn't like to do unnecessary work.
When there is a benefit to the ongoing work necessary to make it and *keep* it threadsafe, it will likely be done.
--
Evan "And yes, I realize the irony of saying how Open Source works in this reply"
Rewriting libraries (Score:3, Informative)
Re:FUD in it's purest form ... (Score:5, Interesting)
It's a threading issue (Score:5, Interesting)
Apache 2 and a recent Linux kernel come pretty close to the theoretical limits of the hardware when it comes to serving static content. It just loafs along while saturating whatever net connection you give it. It's worth trying out.
Bruce
I'm sorry Bruce, you'll have to come back later. (Score:5, Funny)
You're going to stop all the foaming at the mouth, and who wants a half-frothed troll this close to Christmas?
Re:I'm sorry Bruce, you'll have to come back later (Score:5, Funny)
On the other hand, I had looked at the problem reasonably hard when choosing supported software for UserLinux, so I did know something about the problem. So perhaps that disqualifies me.
Bruce
Re:It's a threading issue (Score:2, Insightful)
As projects such as thttpd, tux, boa, lighttpd and many others clearly demonstrate. In fact the performance of Apache 1/2 is no where near what the solutions I've mentioned offer.
Slashdot uses Boa for images (Score:5, Informative)
This isn't to say that Apache is worthless. On the contrary, it is an exceptionally good server. It just doesn't scale as well as some others for static content.
Efficiency is not entirely a web server function (Score:5, Informative)
Bruce
Homegrown apps are one thing... (Score:2)
If not, then you can either run Apache2 with the pre-fork or just accept restarts or run Apache1.x.x
If it will be dealt with then this isn't much of a problem long term. It's just short term growing pains.
Re:Homegrown apps are one thing... (Score:4, Interesting)
Bruce
Re:Homegrown apps are one thing... (Score:3, Interesting)
Which, as I have remarked earlier, is a sympton of PHP never having been designed to run on Windows.
Maybe there's an opportunity for someone to get famous by writing PHP interpreters in both Java and C#, and then they can sell it to all the PHB's out
Re:It's a threading issue (Score:5, Informative)
Either PHP itself, or many PHP applications, are not written to deal with the multi-threading offered by Apache 2.0.
That's just plain not true. The underlying threading problem has little to do with PHP, and absolutely nothing to do with PHP applications, but libraries to which PHP links (libmysqlclient, libpdf, libmcrypt, etc etc etc). It's these third-party libraries (over which the PHP developers have no control) that cause Apache2 to be unstable in the various threading modes (prefork works fine, but is just not officially supported).
S
Re:It's a threading issue (Score:5, Informative)
Bruce
er, no... (Score:4, Informative)
Yes it does. The only exceptions are SYSV IPC objects which don't get automatically reaped, and temporarily created filesystem objects that still have links.
Assuming your kernel isn't buggy, anyway.
Even so (Score:2)
If you use the worker or Win32 MPM, you are stuck with using CGI.
Re:It's a threading issue (Score:3, Informative)
The CGI may be a little slow to start up a PHP interpreter, etc etc, but it is rock solid. That said, using a real multithreaded application server (like, oh, any of your Java app servers) with Apache 2.0 is the best solution.
Re:It's a threading issue (Score:3, Interesting)
I don't understand.
Are the PHP developers not recommending Apache 2 because it is harmful to upgrade? Or are they not recommending Apache 2 simply because there really aren't any benefits to upgrading.
Upgrading (and rolling back an upgrade) Apache has always been pretty simple, and it's pretty easy to have a 1.3 Apache running alongside an Apache 2.0.
Re:It's a threading issue (Score:5, Informative)
To their defense, the PHP folks say the problem is with libraries they don't control. But there could be a thread-safe PHP interface to them.
And I guess the bottom line is that they don't want to keep answering questions about this, so they just say don't upgrade to Apache 2.
Me, I use Zope. I think it's always been multithreaded.
Bruce
Re:It's a threading issue (Score:5, Informative)
As always, the decision over whether to use threads or processes should be based primarily over whether you want to give up protected memory within your application or not (unless you're dealing with a platform like Windows where the process model simply isn't flexible enough to avoid throwing memory protection out the window).
Re:It's a threading issue (Score:5, Informative)
Absolutely. But it's not merely protecting sensitive data--OS architects worked hard for years to implement protected memory, and threads circumvent a lot of those gains (a bug in one thread can affect them all, all memory access needs to be synchronized, etc).
There are good times to use them, but the choice should be based on whether you need to share all (or most) of the memory as opposed to sharing little or none (when processes, possibly with shared memory segments, are the correct choice).
Too many people think that somehow "threads are faster" when (excepting egregious disparities a la Windows) that isn't necessarily true--and even when it is, the performance benefits are often tiny compared to the costs you pay.
Re:It's a threading issue (Score:3, Interesting)
As I recall, an old benchmark showed that a 486 running Linux and Apache could saturate a T1 serving static content. I'm not sure what benefit a "static content" metric has to any discussion concerning modern Web technologies. If static content is your problem, there are gobs of Web server solutions,
Re:Apache 2.x memory model is bizarre (Score:5, Informative)
Bruce
Multi-thread... (Score:2, Insightful)
No need to switch ... (Score:5, Interesting)
Apache 1.3 has been working flawlessly for me. Until I have a compelling need to switch to Apache 2.0, I'm not going to. I understand that there are some nifty new features in Apache 2.0, but not a single one of them is something that I want/need.
This, I think, is the primary reason why people aren't going to Apache 2.0 in droves, not the PHP team's "FUD".
Re:No need to switch ... (Score:3, Insightful)
Exactly. This is happening with a lot of free software lately, namely the Linux kernel... I used to keep up-to-date on the kernel just because it was always getting better.
2.4.x has been rock solid for me and 2.6.x just doesn't offer anything to me that makes
Re:No need to switch ... (Score:4, Insightful)
Hint: Don't wait until the media says linux is desktop-ready.
Re:No need to switch ... (Score:3, Funny)
One 3 too many, and one 7 short of 1337! Work on it. Maybe install Slack or something...
Been using PHP4 and Apache2 for a Long Time (Score:2)
I can't remember when Redhat started using Apache 2, but I've been using it as soon as they included it into their packages.
Is this an issue that would resolve itself as Linux Distributions include Apache 2 and the # of Linux servers increases. As you have a higher volume of Apache 2 servers out there, it will tip the balance toward a friendlier attitude between PHP and Apach
Why are there two?? (Score:5, Insightful)
Can anyone point me to a succint explanation of why there have been an Apache 1.x line and an Apache 2.0 line for years? This to me has always seemed like an implicit statement from the Apache people that I should not yet move to 2.0.
I checked the front page of Apache and there were release announcements for the latest version of both lines. Neither announcement carried a statement indicating when you should use it over the other. The front page does not appear to link to anything addressing the issue, and the FAQ does not appear to handle it, either.
Re:Why are there two?? (Score:2, Informative)
Re:Why are there two?? (Score:5, Informative)
It's on the download page [apache.org]:
"Apache 2.0.52 is the best available version"
"Apache 1.3.33 is also available"
The message would appear to be '2.0.52 is the best, but if you insist you can get a lesser version'.
Re:Why are there two?? (Score:5, Informative)
Re:Why are there two?? (Score:5, Insightful)
I have no problem with that policy at all. But there is nothing at all on the front page to answer the question "Which Apache version should I use?" Even if the answer is not a simple "Use 2.0" or "Use 1.x," there needs to be answers to "Why would I want to use 2.0" and "Why would I want to use 1.x."
I have been interpreting the continued maintenance of the 1.x line for years as a statement that 2.0 was not ready for prime time. I'm pretty sure this was the case at one time. The website needs to just come right out and say, "If you are starting with Apache for the first time, please use 2.0. The 1.x branch continues to be maintained for existing users who need to remain with an older version." Couldn't that at least make it to the FAQ?
Much the same as... (Score:3, Interesting)
Of course before OSS this was never an issue as people didn't have a choice but as people now do, thanks largely in part to the ability of OSS project heads to put a few "free" developers on a older rev for maintenance, large OSS projects often maintain older revs for the sake of the users..
You really need look no further than the Linux Kernel [kernel.org] to see another examp
Started using PHP 5.x + Apache 2.x (Score:2)
PHP and Threaded Apache (Score:3, Informative)
THe apache-2 (Worker MPM) itself is rock solid and definately seems to boost performance of ones http-server compared to traditional apache-1.3.
I am not exactly sure about a prefork-MPM vs apache-1.3 comparison.
The biggest problem with PHP on any threaded Apache-2 (i am not sure if this holds true for the 1.3 series as well)
Switching to the prefork MPM makes everything rock-solid again
If PHP could actually solve their problems with running in a threaded Apache-2
Again
Well worth the upgrade (Score:3, Informative)
Nobody told me! (Score:3, Interesting)
What is supposed to be the problem?
Re:Nobody told me! (Score:3, Informative)
PHP and Apache 2.0 seem fine (Score:3, Insightful)
As mentioned (probably more than once by now), the only issue is some non-thread-safe libraries that PHP can link to. Configuring Apache to run with the "Prefork" MPM solves this problem (by running with the same model as Apache 1.x did).
I see no reason so far to discourage use of Apache 2.0 with PHP other than vague "well, I heard from some guy that he tried it and it had some kind of problem" sort of complaints. Personally, I like the fact that Apache 2.0x has mod_ssl and mod_deflate (/mod_gzip) as part of the codebase, so I no longer have to compile and install them separately...
Religious War... (Score:2)
If the issues are not substantive then why the big hulabaloo?
Religious wars only serve to speed up entropy in the system...
SemWebCentral runs Apache2 + PHP... (Score:2)
It's been serving a decent amount of traffic [semwebcentral.org] for quite a while with no problems...
Using PHP on Apache 2.0 right now. (Score:5, Interesting)
The one thing that I wish PHP would take advantage of in Apache 2.0 is the ability to run code as a user other than the web server. Every time I bring this up with the PHP developers, nobody really runs with it. A feature like this would make PHP much better in shared systems and prevent people from having to do weird things to ensure security. I guess PHP is not that great for shared systems right now.
Re:Using PHP on Apache 2.0 right now. (Score:3, Insightful)
I spoke to the Zend [zend.com] guys about this at OSCON [oreilly.com] six months ago. They said they had a suexec version of PHP in "private Beta". I sent them several emails afterwards asking whether we could test it / help out etc, and haven't received a single reply, so I have no idea whether that's still coming.
Anyone have any more info on this?
cLive ;-)
Re:Using PHP on Apache 2.0 right now. (Score:3, Insightful)
1. why is magic_quotes_gpc on by default? Every time I install PHP somewhere I need to go into the global php.ini and turn this off. Even worse, wh
PHP suExec is available. (Score:3, Interesting)
The one thing that I wish PHP would take advantage of in Apache 2.0 is the ability to run code as a user other than the web server. Every time I bring this up with the PHP developers, nobody really runs with it. A feature like this would make PHP much better in shared systems and prevent people from having to do weird things to ensure security. I guess PHP is not that great for shared systems right now.
suExec for PHP is available. My ISP has switched to PHP suExec several weeks ago. I noticed that somet
Re:Using PHP on Apache 2.0 right now. (Score:3, Interesting)
i agree completely- i have had no end of problems with one of my co workers who continually writes code that requires register_globals and magic_quotes_gpc, no matter how many times i ask him not too. and even though i have told him that those options will be turned off for any new system that i set up, he still asks me why his code is bre
Re:Using PHP on Apache 2.0 right now. (Score:3, Interesting)
Imagine if every system had a gcc.ini, a glibc.ini, and so on?
Imagine if allow_pointers, disable_switch_statement, and short_circuit_boolean were system-wide global settings?
Good luck getting enough compatible software on a system to even boot it!
A language should have defined default behavior. If you want to modify the default b
Making the sqitch (Score:3, Informative)
No its not worth it, (Score:5, Funny)
Stick with kernel 1.3.79 and Apache 1.1 just to be "safe".
What extensions? (Score:4, Interesting)
apachetoolbox supports the 1.x apache (Score:3, Interesting)
I've done the roll-your-own apache/mod_perl/mod_php/mod_etc.etc.etc... thing before. I'd love to have those hours of my life back. So if the Apache foundation really cares about evangelizing 2.x why don't they create something as powerful as ApacheToolbox that actually works with 2.x?
How many hits? (Score:5, Informative)
I think they're right (Score:4, Interesting)
Personally, I'd like to see more server alternatives to Apache anyway. I think there should be a handful of FOSS web servers capable of hosting PHP, web servers that make different kinds of tradeoffs between performance, security, and ease-of-use. The huge market share that Apache has, from my point of view, is a problem, just like the huge market share that Microsoft has in other areas.
Re:I think they're right (Score:3, Informative)
Apache Tweak. (Score:5, Interesting)
The problem is running apache in WORKER or PERCHILD MPM modes. Those are the ones that are using threading.
What I'd recommend to anyone who wants to have a robust, fast apache implementation is to do the following:
There you go... performance increase for 75% of serving requests.
P.S: Avoid perchild at all costs!
FUD is logical. (Score:4, Insightful)
[F]ear - what if my PHP processes crash?
[U]ncertainty - has this thing been tested yet?
[D]oubt - Hmmm I'm not sure...
And as far as I know, no one has dared to make a COMPLETE TEST of PHP running with Apache2, explaining which PHP modules fail and why.
In other words, it's simply FEAR OF THE UNKNOWN what the php community has about Apache2.
Re:FUD is logical. (Score:3, Interesting)
This is what I want to know. Which modules use libraries that are threadsafe (or have threadsafe versions)? Which modules are known to crash the thread?
I build php here with postgresql as the only additional library over whatever the default modules are (and I have found threadsafe patches for libpq). Is having threadsafe libraries enough?
Stop picking on PHP (Score:4, Insightful)
They just need some time to catch up. Apache 2.x is light years faster/leaner/meaner then 1.x was. Oh, and PHP runs perfectly fine under 2.x, as others have pointed out.
OK, so yea, it's actually kinda sad (read: pathetic)
Re:Stop picking on PHP (Score:3, Interesting)
This kind of misses the point. The assumption "why bother with apache 2.0 if it doesn't run in multi-threaded mode" misses all the cool things that have gone into apache 2.0 outside of the threading models. I'ts a lot saner, and has cool things like chaining (output of CGI can go through SSI) and a million other things.
mod_lisp (Score:3, Interesting)
changes how things are done, and not what is done (Score:3, Insightful)
Apache1 has been tried, tested, and true and has reached a lovely 1.3.33 version, of which security patches are rare and bugfixes are also rare. Similar situation with mod_ssl. So why leave your nice warm, structurally stable house in favour of the blistering cold to try something new that has a new version for bugs and security on a much more common basis? Personally, until Apache 2 gains some serious market share, I see no reason to leave. We provide hosting- and need reliability, and can't be wasting time with constant updates (though updates are better than not fixing of course) when we could otherwise stick with Apache 1.
Apache1 does one thing, and does it well. Period. Sure there are crazy new features of Apache2, and I've tried them else. Personally, I see nothing compelling to move at this point. There are a few small 'that would be nice' features, but really nothing exciting in the way of Linux2.6, WindowsXP, etc. Even 2.6 is having slow adoption. You can only find it on workstations, because no supportive provider is about to live on the bleeding edge and leave their customers bleeding. Apache on the other hand doesn't have a place on the workstation (unless it doubles as a causal server), so in the same way, you're trying to get those folks who prefer stable releases (like Debian stable) over bleeding edge.
So why switch?
"Bad press leads to lots of misinformed morons saying stupid things about how Apache 2 is not ready for prime time." -- I guess I'm one of those morons. Personally I'm not about to replace one of the core pieces of software between us and our customers with something that hasn't proven itself to me. We've set it up in testing environments, and found that it performed similarly and didn't offer anything new we need.
Apache2.0 = XFree86 (Score:3, Interesting)
Whats stopping anyone from uniting php and apache1.3 and packaging them together for each platform the way sqlite was incorporated into php? They go well together, makes alotta sense to be the same project.
From a webhosting standpoint... (Score:3, Informative)
That said, everyone should hope 1.x to die ASAP. Basically the Apache developers have to do double duty maintaining two completely seperate branches. If everyone could let 1.3 die then there would be a LOT more manpower available to concentrate on 2.0. For many many years they have said that no new features are going into 1.3 -- everything is happening on 2.x. Yet they still have to maintain security fixes and chase down bugs on the 1.3 branch which is very creaky. There is a reason, after all, that they decided to rewrite everything for 2.x.
Re:The site appears to be struggling (Score:2)
Re:A solution looking for a problem. (Score:2)
And then there's supposed to be a per-child MPM that can separate multiple users better. I've never heard more of it these days. Anyone knows whatever happened to it? If there's one compelling reason to upgrade to Apache 2, that's _it_ for me.
Re:Frontpage (Score:3, Informative)
In my experience, FrontPage actually works quite a bit better with Apache 2.0. FrontPage for Apache 1.x requires patching your Apache or downloading pre-patched binaries from rtr.com or Microsoft. FrontPage for Apache 2 can load cleanly as a module, no server modifications needed.
If you want the offical notice of Apache 2 support, see here [rtr.com].
Re:Apache2: The only choice for Win32 (Score:4, Interesting)
Apache 2 threaded MPMs can run different vhosts under different users, so this has been fixed for over two years. If PHP was thread-safe, you wouldn't have a problem, but as this story highlights, PHP doesn't play nice with threads.
Re:PHP and Subversion (Score:4, Informative)