Re: [PHP-DEV] Re: PHP and Apache2
Due to a lot of emails and bug reports from SunONE webserver users, the apache2 multithreading message should also be marked as important for *ALL* multithreaded webservers. With some modifications it could be used for all multithreaded environments not only Apache2. We could link this faq message from all multithreaded webserver install sections. Especially for SunONE webservers there is also the possibility to use FastCGI since version 6.1 (the Zend module is bundled there, but without any documentation and click'n'play availability in the admin server) - so users want to use ext/GD... can use this with some speed drawback (the NSAPI module is *very* fast compared to FastCGI - because multithreaded) and missing features (no virtual() function, no apache-like php_value options). Uwe At 11:56 16.06.2004, Jan Lehnardt wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, On 16 Jun 2004, at 11:35, Joseph Lee wrote: I have seem this questions been asked many times in a few mail list. Someone should post this reply into a FAQ page or the Manual in www.php.net I am about to commit this to the installation chapter of the manual. Jan - -- GPG Key: BB96 56B0 Q: Thank Jan? - A: http://geschenke.an.dasmoped.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (Darwin) iD8DBQFA0Bk17KW8t7uWVrARAmfUAJ9mIGqzR0WOe90AHNB/p00HMUbn5QCeNC8a I6o3NcztxMST3cWRpZJvac4= =dz2E -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php - Uwe Schindler [EMAIL PROTECTED] - http://www.php.net NSAPI SAPI developer Erlangen, Germany -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
Rasmus Lerdorf wrote: On Wed, 16 Jun 2004, Marc Richards wrote: Going form Apache1 to Apache2, aside form filters (which you mentioned in bug 27583) there is the default inclusion of mod_ssl and mod_ldap, better Internationalization features, mod_perl 2.0 (which ONLY works with Apache2), Subversion via WebDAV, and also the fact that many Linux distribution ship Apache2+prefork by default (e.g. Red Hat Enterprise Linux). Some of these features (mod_ldap and mod_perl) are still in the experimental stages and therefore only run in development, but I want to be able to standardize on Apache2 for development and production. To top it off like you said Apache1 is pretty poor on Windows, so I also want to standardize on Apache2 (without PHP) on windows and Linux. You are right, the argument against Apache2+prefork is nowhere near as strong. What you list here has very little to do with PHP though, it has more to do with convergence of things onto a single platform for your particular needs. Yep - that is the one :) It would be nice to know how many of us ARE using A2, just out of interest. For me the motivation to put time into Apache2+prefork development is minimal. The module API has changed completely, so all my custom Apache modules will have to be rewritten and what do I get in return? Filters that I can't really use anyway? This is not compelling enough for me. There has to be a big win for me to take the migration hit. Just like if you tried to convince me to switch to aolserver or Caudium. It is a very different server and for the most part just shares the name. We felt the need for the warning to make sure people understood that Apache2 is not just the latest stable version of Apache1.3.x and that Apache1 is still the server we can with confidence say will work in a production environment. Are we actually looking at development time? Perhaps we just need to run test on the alternative platform(s) I have two machines running W2k/A2/PHP5RC3/Firebird1.5 which are serving up demos, and I've yet to see an error. The SUSE9.1 machine is on the bench and should be live next week - with the same server setup. So what can I do to help ? (p.s. I don't have the windows tools to compile) -- Lester Caine - L.S.Caine Electronic Services -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
On Thu, 17 Jun 2004, Lester Caine wrote: Are we actually looking at development time? Perhaps we just need to run test on the alternative platform(s) I have two machines running W2k/A2/PHP5RC3/Firebird1.5 which are serving up demos, and I've yet to see an error. The SUSE9.1 machine is on the bench and should be live next week - with the same server setup. So what can I do to help ? (p.s. I don't have the windows tools to compile) Well, how confident are you that the prefork mpm doesn't leak memory for example? There was a flood of messages about serious memory leaks on the Apache dev list just today, for example, and that was just for static requests, never mind more complex dynamic ones. So yes, we are talking about both testing time and development time trying to track down stuff like memory leaks to figure out if it is an Apache2 problem or a misunderstanding of how to use this new and rather unfamiliar API. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
Rasmus Lerdorf wrote: On Thu, 17 Jun 2004, Lester Caine wrote: Are we actually looking at development time? Perhaps we just need to run test on the alternative platform(s) I have two machines running W2k/A2/PHP5RC3/Firebird1.5 which are serving up demos, and I've yet to see an error. The SUSE9.1 machine is on the bench and should be live next week - with the same server setup. So what can I do to help ? (p.s. I don't have the windows tools to compile) Well, how confident are you that the prefork mpm doesn't leak memory for example? There was a flood of messages about serious memory leaks on the Apache dev list just today, for example, and that was just for static requests, never mind more complex dynamic ones. My setup seems stable. 160k for the last week, but with 1G to grow into it could be a while before I notice a problem :) So yes, we are talking about both testing time and development time trying to track down stuff like memory leaks to figure out if it is an Apache2 problem or a misunderstanding of how to use this new and rather unfamiliar API. I'll start taking more interest in it - since I've not seen a problem there hasn't been much incentive ;) -- Lester Caine - L.S.Caine Electronic Services -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
* Thus wrote Rasmus Lerdorf ([EMAIL PROTECTED]): On Wed, 16 Jun 2004, Lester Caine wrote: Lester Caine wrote: What I should have added is:- What are the problem modules? :) Ah, you see, if we knew that we would just fix them and be done with it. Thanks rasmus for rewriting this (well hopefully it was a template of some sort :) Curt -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
On Tue, 15 Jun 2004 22:56:44 -0700 (Pacific Standard Time), Rasmus Lerdorf [EMAIL PROTECTED] wrote: On Wed, 16 Jun 2004, Lester Caine wrote: Lester Caine wrote: What I should have added is:- What are the problem modules? :) [snip] Perhaps this should be put into the docs rather than the current statement which doesn't say anything about what the problem actually is :P -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
On Wed, 16 Jun 2004, Curt Zirzow wrote: * Thus wrote Christian Schneider ([EMAIL PROTECTED]): Lester Caine wrote: Well is it approved for use with Apache2? Correct me if I'm wrong but my understanding is that the PHP core is approved with Apache2 in threaded mode. If my memory serves my right, I dont think that all extesions in php can be guaranteed to be thread safe. Correct. We've been using Apache 2 prefork / PHP 4 in production for quite a while now without any problems. To note also, i've been using prefork in a production evironment as well, whithout hickups. THough there is no good reason to run apache 2 in prefork mode over apache 1.3... I'd pick apache 1.3 then as it has a more stable codebase. Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: PHP and Apache2
Lester Caine wrote: The only difficulty is Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows. in the manual tells my customers that I should not be! There is also good Rasmus' explanation at http://bugs.php.net/bug.php?id=27583 Jakub Vrana -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, On 16 Jun 2004, at 11:35, Joseph Lee wrote: I have seem this questions been asked many times in a few mail list. Someone should post this reply into a FAQ page or the Manual in www.php.net I am about to commit this to the installation chapter of the manual. Jan - -- GPG Key: BB96 56B0 Q: Thank Jan? - A: http://geschenke.an.dasmoped.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (Darwin) iD8DBQFA0Bk17KW8t7uWVrARAmfUAJ9mIGqzR0WOe90AHNB/p00HMUbn5QCeNC8a I6o3NcztxMST3cWRpZJvac4= =dz2E -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
Jan Lehnardt wrote: I have seem this questions been asked many times in a few mail list. Someone should post this reply into a FAQ page or the Manual in www.php.net I am about to commit this to the installation chapter of the manual. Looking forward to it :) -- Lester Caine - L.S.Caine Electronic Services -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
Rasmus Lerdorf wrote: [snip] The problem here is not as simple as people like to make it sound. Time and time again I see the /. mentality where people berate PHP developers for being stupid and stubborn for not just fixing PHP so it is stable and robust with Apache2. I have explained this a number of time, but here we go again. [snip] You make a very strong and compelling argument about why not to use PHP with Apache2 + a multithreaded MPM And yes, you could use the prefork mpm with Apache2 to avoid the threading, and yes you could use a standalone fastcgi mechanism to avoid the threading, but you are going out of your way to avoid the defining characteristic of the web server you have decided to use. And then you tack on a fairly weak argument about not using Apache2 + the prefork MPM. Going form Apache1 to Apache2, aside form filters (which you mentioned in bug 27583) there is the default inclusion of mod_ssl and mod_ldap, better Internationalization features, mod_perl 2.0 (which ONLY works with Apache2), Subversion via WebDAV, and also the fact that many Linux distribution ship Apache2+prefork by default (e.g. Red Hat Enterprise Linux). Some of these features (mod_ldap and mod_perl) are still in the experimental stages and therefore only run in development, but I want to be able to standardize on Apache2 for development and production. To top it off like you said Apache1 is pretty poor on Windows, so I also want to standardize on Apache2 (without PHP) on windows and Linux. I understand (I think) your opposition to the direction Apache is moving in, and I realize that you personally prefer Apache1, but I think this question has come up enough times to show that there are users out there that want to, and need to, and ARE in fact using Apache2+prefork+PHP in production. I guess we have to wait until the PHP developers feel the time is right a submit Apache2 to more stringent testing. I'd tell you that our servers have been running it fine, but I doubt we get as many hits as you do over at Yahoo!. I guess I'll wait and see what the text of the new Apache2 warning says, maybe more Apache2 voices will come out of the woodwork then, but somehow I get the feeling that it is going to be more along the lines of apache2+worker is evil, and apache1 is better than apache2+prefork rather than PHP works with apache2+prefork but is not as well tested as it is with apache1. Marc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
On Wed, 16 Jun 2004, Marc Richards wrote: Going form Apache1 to Apache2, aside form filters (which you mentioned in bug 27583) there is the default inclusion of mod_ssl and mod_ldap, better Internationalization features, mod_perl 2.0 (which ONLY works with Apache2), Subversion via WebDAV, and also the fact that many Linux distribution ship Apache2+prefork by default (e.g. Red Hat Enterprise Linux). Some of these features (mod_ldap and mod_perl) are still in the experimental stages and therefore only run in development, but I want to be able to standardize on Apache2 for development and production. To top it off like you said Apache1 is pretty poor on Windows, so I also want to standardize on Apache2 (without PHP) on windows and Linux. You are right, the argument against Apache2+prefork is nowhere near as strong. What you list here has very little to do with PHP though, it has more to do with convergence of things onto a single platform for your particular needs. For me the motivation to put time into Apache2+prefork development is minimal. The module API has changed completely, so all my custom Apache modules will have to be rewritten and what do I get in return? Filters that I can't really use anyway? This is not compelling enough for me. There has to be a big win for me to take the migration hit. Just like if you tried to convince me to switch to aolserver or Caudium. It is a very different server and for the most part just shares the name. We felt the need for the warning to make sure people understood that Apache2 is not just the latest stable version of Apache1.3.x and that Apache1 is still the server we can with confidence say will work in a production environment. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
* Thus wrote Christian Schneider ([EMAIL PROTECTED]): Lester Caine wrote: Well is it approved for use with Apache2? Correct me if I'm wrong but my understanding is that the PHP core is approved with Apache2 in threaded mode. If my memory serves my right, I dont think that all extesions in php can be guaranteed to be thread safe. If you use non-threadsafe modules you have to use Apache 2 in --mpm=prefork mode and then it's approved too. We've been using Apache 2 prefork / PHP 4 in production for quite a while now without any problems. To note also, i've been using prefork in a production evironment as well, whithout hickups. btw, thanks for changing the subject :) Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: PHP and Apache2
Christian Schneider wrote: Lester Caine wrote: Well is it approved for use with Apache2? Correct me if I'm wrong but my understanding is that the PHP core is approved with Apache2 in threaded mode. If you use non-threadsafe modules you have to use Apache 2 in --mpm=prefork mode and then it's approved too. We've been using Apache 2 prefork / PHP 4 in production for quite a while now without any problems. As Pan says That is fine. Personally I am running PHP5/Apache2 24/7 without any problems. The only difficulty is Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows. in the manual tells my customers that I should not be! Either we are moving to Apache2, or THAT is a dead end? When I started playing with this Apache2 was recommended for Windows because of problems with Apache1. Should I change back now and throw Apache2 in the bin? The original statement was Is PHP4 and 5 going to end up in the same mess both being required to be maintained and no incentive to drop the old version exactly like Apache? -- Lester Caine - L.S.Caine Electronic Services -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: PHP and Apache2
Lester Caine wrote: What I should have added is:- What are the problem modules? :) -- Lester Caine - L.S.Caine Electronic Services -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: PHP and Apache2
On Wed, 16 Jun 2004, Lester Caine wrote: Lester Caine wrote: What I should have added is:- What are the problem modules? :) Ah, you see, if we knew that we would just fix them and be done with it. The problem here is not as simple as people like to make it sound. Time and time again I see the /. mentality where people berate PHP developers for being stupid and stubborn for not just fixing PHP so it is stable and robust with Apache2. I have explained this a number of time, but here we go again. Apache2 is a complete rewrite and a complete architecture change from Apache1. It's not like going from PHP3 to PHP4 or from PHP4 to PHP5. There is a lot of code that is common, and certainly the base architecture of PHP hasn't changed for years. So comparing Apache1 vs. Apache2 to PHP4 vs. PHP5 makes no sense. As far as I am concerned I see no reason for Apache1 development to stop. The architecture has been proven over the years and the code, while somewhat unwieldy in places, is a known entity. PHP from the very early days was designed against this basic Apache1 architecture and works extremely well running under it. The major feature that draws people to Apache2 is threading. On Windows where most basic libraries are, and must be, threadsafe, Apache2 does actually make sense and it would be good to work out the kinks on that platform. However, on UNIX there are a lot of basic libraries where thread safety is an unknown. And here I am not talking about PHP extensions, I am talking about 3rd-party libraries underneath our hundreds of extensions. Whether any one 3rd-party library is threadsafe is really hard to determine. There are a lot of variables involved, including which OS, which version of the OS, which libc, which version of that libc and on some platforms even the compiler flags used to compile these things. And to make it even more fun, tracking down a thread safety problem is damn well near impossible. Hundreds of people may well post to this list that Apache+PHP+ext/foo works perfectly for them, but maybe they are only getting about a million hits a day. Then another user comes along who gets 100 million hits a day and uses a fast dual-cpu machine and everything blows up because now suddenly the window for some tiny race condition has been made much larger due to the faster cpu speeds, the second cpu and the higher frequency of requests. And the bug report we get from this user will be something along the lines of: It don't work sometimes. Most of the times it works fine, but then every now and then it just don't. The error is different each time and I have no idea how to reproduce it, but fix it right away!!! What do you suggest we do about these? I tracked one of these down a couple of years ago. Someone was using an early version of Apache2 with the PostgreSQL libpq client library. The PostgreSQL developers swore up and down that their library was threadsafe and I spent a whole day eliminating libraries one by one. Luckily this particular problem was somewhat reproducable. If I banged hard enough at one section which created new accounts every now and then an account would end up with a bogus password entry and the user wouldn't be able to log in. It turned out that libpq was using the system's crypt() function which was not threadsafe. So the account creation which used something line INSERT INTO users ... CRYPT($password)... would mess up when 2 or more threads were trying to do this at the same time. This wasn't PHP's fault in any way, it wasn't really PostgreSQL's fault either, but it was still broken. I can give you a number of (fixable) technical reasons why I don't think Apache2+PHP is a good idea in a production environment, but setting those aside it really boils down to one simple concept: PHP is glue. It is the glue we use to build cool web applications by sticking dozens of 3rd-party libraries together and making it all appear as one coherent entity through an intuitive and easy to learn language interface. The flexibility and power of PHP relies on the stability and robustness of the underlying platform. We need a working OS, a working web server and working 3rd-party libraries to glue together. When any of these stop working we need ways to identify the problems and fix them quickly. By making the underlying framework more complex by not having completely separate execution threads, completely separate memory segments and a strong sandbox for each request to play in, we introduce feet of clay into our system. And yes, you could use the prefork mpm with Apache2 to avoid the threading, and yes you could use a standalone fastcgi mechanism to avoid the threading, but you are going out of your way to avoid the defining characteristic of the web server you have decided to use. At this point in its development, I still maintain that you are better off simply sticking with Apache1 for serving up PHP pages with the one caveat that Apache1 sucks