Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-03-17 Thread Rasmus Lerdorf
symbulos partners wrote:
Dear friends,
we would like to migrate a server where we host several websites (in virtual
hosting) to PHP 5 with Apache 2.
Technical support at the hosting provider told us there are still problems
about safety of threads on php 5 + Apache 2 (management of memory). They
would propose to migrate Apache to the pre-fork version in order to avoid
these problems (but we would be unable to use all the features of Apache
2). 

Is that right?
Yes, if you are going to use Apache2, use the prefork MPM.
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-07 Thread symbulos partners
Jason Barnett wrote:
 exercise for myself, but then again I don't need to either.  ;)  This
 would also be something that would be a great benefit to share with the
 PHP community if you decide to compile this list of thread-safe
 extensions.

If we could share a bit of the effort with someone else, we would be
available (February). Eventually we could host the page on our website, f
necessary.

We could have a simple php base page where people could flag libraries /
sets of functions after checking. A simple table, in order to understand. 

We could manage it by e-mail eventually.
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-07 Thread Richard Lynch
symbulos partners wrote:
 Jason Barnett wrote:
 exercise for myself, but then again I don't need to either.  ;)  This
 would also be something that would be a great benefit to share with the
 PHP community if you decide to compile this list of thread-safe
 extensions.

 If we could share a bit of the effort with someone else, we would be
 available (February). Eventually we could host the page on our website, f
 necessary.

 We could have a simple php base page where people could flag libraries /
 sets of functions after checking. A simple table, in order to understand.

 We could manage it by e-mail eventually.

After checking?

There is *NO* exhaustive test to do, from everything I've ever heard...

Now if you want to come up with a test harness that claims to stress-test
some given code-base, with version numbers of all the under-lying code,
and hardware, come to think of it, and try to track the amount of testing
that has been done, and assign probability curves to the thread-safeness
of any given combination...

It ain't gonna be no simple table, though, really.

You might get somebody to say Core PHP is Thread-safe

They might even believe that.

They *might* even be right.

For their version of PHP.

On their OS.

Under that *version* of their OS.

With their hardware.

It don't mean a whole lot to anybody who doesn't have that *exact* same
setup.

You'd almost have to work out a list of all known variables, and then a
weighting system for (number-of-hours-run X
number-of-concurrent-processes) multiplied by the server load to give each
report a score

If I tell you it's been fine on my low-traffic servers, it don't mean
squat.  If Rasmus tells you PHP X + MySQL Y + OS Z == Good on Yahoo,
that has some meaning, but not a whole lot if you change *any* of the
variables in the equation.

So then, you'd have a very large (and quite sparse, probably) matrix of
the probability that any given combination of every software package (and
hardware?) is thread-safe.

Not saying it's not a Good Idea, nor that you shouldn't be doing this:  I
just want you to understand that you've severely under-estimated the scale
and scope of the problem to be addressed, and have a concomitant
simplisitic design going here.

Make it complex enough to be useful, and make it easy to search and report
on various combinations, it could be a real boon.

But if your site just says PHP 4.1.3 + MySQL 3.23.4 == Good...  I'm not
going to put much faith in that for thread-safety.

But maybe I'm just a negative guy :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-06 Thread symbulos partners
We know that. We understood all of that.

What we need to know is:

1)Are php core function thread safe?

2)Does php have internal mechanisms in php for protecting thread safety
(memory leak, threads overwriting memory in use by another thread, blah,
blah)?

3)Are the function in this LIMITED LIST thread safe? (This is THE LIMITED
LIST extracted from the list of the functions in section VI, the one you
requested, the one R.Lynch requested). Since we sent the list with the
functions we need already 2 times, would you please be so gentle as to
answer now?

Apache-specific Functions
Array Functions
Calendar Functions
Class/Object Functions
CURL, Client URL Library Functions
Cyrus IMAP administration Functions
Date and Time Functions
Direct IO Functions
Directory Functions
DOM Functions
DOM XML Functions
Error Handling and Logging Functions
File Alteration Monitor Functions
Filesystem Functions
Forms Data Format Functions
FTP Functions
Function Handling Functions
Gettext
GMP Functions
HTTP Functions
Image Functions
IMAP, POP3 and NNTP Functions
PHP / Java Integration
LDAP Functions
Mail Functions
Mathematical Functions
Multibyte String Functions
Mimetype Functions
Miscellaneous Functions
MySQL Functions
Improved MySQL Extension
Network Functions
Unified ODBC Functions
Object Aggregation/Composition Functions
Object property and method call overloading
OpenSSL Functions
Output Control Functions
PDF functions
PHP OptionsInformation
PostgreSQL Functions
Program Execution Functions
Session Handling Functions
Shared Memory Functions
SimpleXML functions
SQLite
Shockwave Flash Functions
Standard PHP Library (SPL) Functions
String Functions
URL Functions
Variable Functions
vpopmail Functions
XML Parser Functions
XML-RPC Functions
XSL functions
XSLT Functions

-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-06 Thread Jason Barnett
Symbulos Partners wrote:
We know that. We understood all of that.
Let me ask you this.  Do you know what underlying libraries are 
associated with the extensions you want to use (in your list below)?  If 
you do then you *should* be able to google for each library individually 
and see if that library is thread safe.  I have not gone through this 
exercise for myself, but then again I don't need to either.  ;)  This 
would also be something that would be a great benefit to share with the 
PHP community if you decide to compile this list of thread-safe extensions.


What we need to know is:
1)Are php core function thread safe?
I have read somewhere that this is true, but I have absolutely no 
firsthand experience in PHP's source to tell you if this is the case. 
Rasmus will know (whistling and walking away...)

2)Does php have internal mechanisms in php for protecting thread safety
(memory leak, threads overwriting memory in use by another thread, blah,
blah)?
Yes it does... IIRC check out TSRM in the source.
3)Are the function in this LIMITED LIST thread safe? (This is THE LIMITED
LIST extracted from the list of the functions in section VI, the one you
requested, the one R.Lynch requested). Since we sent the list with the
functions we need already 2 times, would you please be so gentle as to
answer now?
I have no idea.  ;)  But I use a lot of these functions as well and it 
would be good to know.

Apache-specific Functions
Array Functions
Calendar Functions
Class/Object Functions
CURL, Client URL Library Functions
Cyrus IMAP administration Functions
Date and Time Functions
Direct IO Functions
Directory Functions
DOM Functions
DOM XML Functions
To anyone reading this, remember he's using PHP 4.3.x but he's asking 
about PHP 5.x.  So I guess the question there: is libxml2 thread-safe?

Error Handling and Logging Functions
File Alteration Monitor Functions
Filesystem Functions
Forms Data Format Functions
FTP Functions
Function Handling Functions
Gettext
GMP Functions
HTTP Functions
Image Functions
IMAP, POP3 and NNTP Functions
PHP / Java Integration
LDAP Functions
Mail Functions
Mathematical Functions
Multibyte String Functions
Mimetype Functions
Miscellaneous Functions
MySQL Functions
Improved MySQL Extension
Network Functions
Unified ODBC Functions
Object Aggregation/Composition Functions
Object property and method call overloading
OpenSSL Functions
Output Control Functions
PDF functions
PHP OptionsInformation
PostgreSQL Functions
Program Execution Functions
Session Handling Functions
Shared Memory Functions
Good lord I would hope so :)
SimpleXML functions
SQLite
Shockwave Flash Functions
Standard PHP Library (SPL) Functions
String Functions
URL Functions
Variable Functions
vpopmail Functions
XML Parser Functions
XML-RPC Functions
XSL functions
XSLT Functions
All of the XSL stuff should fall under the umbrella of is libxml2 
thread safe? since we use that library for XSL functionality too.

One final note.  I notice that you make of the PHP4 XML libraries? 
Well, there was a break in this functionality in PHP5.  If you used the 
almost W3C compliant domxml functions then you should be ok.  If not, 
well, you might be in for some rewriting there.  :(

http://php.net/manual/en/ref.dom.php
--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-06 Thread Rasmus Lerdorf
On Thu, 6 Jan 2005, Jason Barnett wrote:
 Symbulos Partners wrote:
  We know that. We understood all of that.
  
 
 Let me ask you this.  Do you know what underlying libraries are associated
 with the extensions you want to use (in your list below)?  If you do then you
 *should* be able to google for each library individually and see if that
 library is thread safe.  I have not gone through this exercise for myself, but
 then again I don't need to either.  ;)  This would also be something that
 would be a great benefit to share with the PHP community if you decide to
 compile this list of thread-safe extensions.

Keep in mind that it isn't that simple.  If it was we would have done this 
long ago.  Whether something is threadsafe depends on a lot of factors.  
The author of a certain library might tell you his library is threadsafe, 
but depending on how you compile it and which libc you are using it may or 
may not be threadsafe.  So, while one person's library on his platform 
will work perfectly and be threadsafe, that exact same library on another 
platform may not be.

Some examples of this are the c-client (imap) library and the postgresql 
library.  Both may or may not be threadsafe depending on your platform and 
how you build them.  Your crypt() libc call isn't threadsafe, for example.  
libpq used to call crypt() if you used the PASSWD() function in an SQL 
query.  Now you might tick along for months without ever having 2 threads 
execute the SQL query that calls PASSWD() at exactly the same time, but 
then suddenly your lucky karma runs out and they do.  You end up with 2 
records in your database that are corrupted.  The PostgreSQL guys fixed 
this, I think, but prior to this they were saying that libpq was 
threadsafe.  The problem is always in code you don't control.  They didn't 
control the libc crypt implementation and it bit them.  

I guarantee that there are dozens if not hundreds of examples of problems 
like this in just about every library, and probably a few left in PHP 
itself still.  Unless someone hits a problem (which is likely) and 
recognizes it for what it is (which is unlikely) and informs the 
developers these tricky thread problems are never going to be fixed.

I still content that humans are simply not smart enough to write 
threadsafe code for a largescale heterogenious project such as PHP with 
all the platforms and libraries that all have to interact perfectly.

-Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-06 Thread Greg Donald
On Thu, 06 Jan 2005 16:15:43 +, symbulos partners
[EMAIL PROTECTED] wrote:
 We know that. We understood all of that.
 
 What we need to know is:

Please, do not assimilate me.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Apologies for the last e-mail concerning (Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33)

2005-01-06 Thread Richard Lynch
Plan on doing a LOT of testing -- My guesses on the probability of
thread-safety were just that:  GUESSES

Thread-safe bugs are the kind of thing that can remain hidden for *YEARS*
or even *DECADES* and not get triggered but once in a million executions
of your scripts.

By definition, they rely on *TWO* copies of your script running in
parallel and timing is everything.

For example, suppose your script is like this:

?php
/* LOTS OF CODE */
thread_bug_function();
/* LOTS OF CODE */
?

You can run that script a million times, and nothing will go wrong.

You can even run your web-server with multiple copies of your PHP script
running a million times and nothing will go wrong.

Let's examine the case of just *TWO* Apache children processes, running
your script in parallel.

Depending on when one script starts, when it gets interrupted by the OS so
other processes can run, and when it re-starts, you have *THREE* possible
cases:

(where the time at which something is run is indicated in a vertical
manner.

CASE #1:
APACHE CHILD ONEAPACHE CHILD TWO
?php   ?php
/* LOTS OF CODE */  /* LOTS OF CODE */ thread_bug_function();
thread_bug_function();  /* LOTS OF CODE */
/* LOTS OF CODE */ ?
?

CASE #2:
APACHE CHILD ONEAPACHE CHILD TWO
?php   ?php
/* LOTS OF CODE */  /* LOTS OF CODE */
thread_bug_function();
/* LOTS OF CODE */ thread_bug_function(); /* LOTS OF CODE */
? ?

CASE #3:
APACHE CHILD ONEAPACHE CHILD TWO
?php   ?php
/* LOTS OF CODE */  /* LOTS OF CODE */
thread_bug_function();  thread_bug_function();
/* LOTS OF CODE */  /* LOTS OF CODE */
?  ?


CASE #1 and CASE #2 cause no problem at all -- The 'thread_bug_function'
doesn't run at the same time in one child as the other child, because of
the timing -- it runs BEFORE or AFTER the same function in the other
child.

CASE #3 will crash big-time, because the thread-bug got executed at the
SAME TIME in BOTH children.

But here's the thing:  The *larger* your code base, the better the odds
are that CASE #1 and CASE #2 will happen, because there is so much going
on in the /* LOTS OF CODE */ sections.

The ONLY time the bug is triggered is when the two scripts happen to try
to execute the buggy line AT THE SAME TIME.

So CASE #3 is super super super rare.  And it gets more and more rare as
you add more and more code (yours or the PHP Modules you are asking about)
to your project.

The more you think about this, the more you'll realize just how impossible
a question you are posing, and just how complicated you are making your
server by using threads.

There is NO PRACTICAL WAY to systematically test for a thread bug.

Only disciplined coding by experienced software developers will avoid
thread bugs -- and even that is hardly a given

So you're really really really going out on a limb to use the threads.

If you *NEED* the threads, you are going to have to pay a heavy heavy
heavy price in doing a *TON* of testing under heavy load servers, with as
much variance in timing of script start/end as you can introduce.

Every line of code you add, and every Module you load in to add
functionality/features will GEOMETRICALLY INCREASE your risk and the need
for testing.

The reason you kept getting bad answers, or answer at all, is you kept
asking a bad question :-)

Things to consider:
#1. Do you really *NEED* threads?
#2. If you *DO* need them, can you segment your application and modularize
and isolate the thread usage to a single server, or a single body of code,
or an isolated case that will be called rarely or ???
#3. Do you have the resources to run a billion tests?

If you need threads, and you can't isolate them to a sandbox, and you
don't have the resources for a billion tests, QUIT NOW.

You will save yourself a ton of money and frustration by not tackling an
insurmountable project that will ruin you.

A man's got to know his limitations
   -- Dirty Harry

symbulos partners wrote:
 I apologise for the last e-mail concerning this subject, but I had not
 received your e-mail back.

 Thanks for the explanations, they will be very useful.
 --
 symbulos partners
 -.-
 symbulos - ethical services for your organisation
 http://www.symbulos.com



-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-06 Thread John Nichel
Greg Donald wrote:
On Thu, 06 Jan 2005 16:15:43 +, symbulos partners
[EMAIL PROTECTED] wrote:
We know that. We understood all of that.
What we need to know is:

Please, do not assimilate me.
Who's going to clean up this Mt. Dew that I just shot out of my nose?  *L*
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-05 Thread symbulos partners
Richard Lynch wrote:
 If you re-read the previous emails from Rasmus, you will find that these
 questions are already answered within them.
 
 So I'm going to go on at length here telling you (again) what you don't
 want to hear.

In my opinion, the answer some libraries are thread safe, some are not is
generic. The answer the libraries in chapter VI. Function Reference of
official PHP Manual version 03-01-2005 is specific. Now I think I
understand the answer a bit better.

We did not understand if you were talking about the libraries we develop,
the libraries you develop, the libraries everybody else develops,
commercial libraries, whatever library you can think of. Not
all the libraries are indeed listed in the manual.

I apologise for being stupid and hard of understanding.

 If you can narrow your focus down a bit from *ALL* of Section VI to *just*
 the libraries you *really* need, you might get the answer you want to
 hear: Oh, those are all thread-safe.

Here some more specific questions.

1)Is the core of php thread safe? That is, are the function which do not
need external libraries thread safe?

2)Here is the list of the function sets we need to use, from Section VI

Apache-specific Functions
Array Functions
Calendar Functions
Class/Object Functions
CURL, Client URL Library Functions
Cyrus IMAP administration Functions
Date and Time Functions
Direct IO Functions
Directory Functions
DOM Functions
DOM XML Functions
Error Handling and Logging Functions
File Alteration Monitor Functions
Filesystem Functions
Forms Data Format Functions
FTP Functions
Function Handling Functions
Gettext
GMP Functions
HTTP Functions
Image Functions
IMAP, POP3 and NNTP Functions
PHP / Java Integration
LDAP Functions
Mail Functions
Mathematical Functions
Multibyte String Functions
Mimetype Functions
Miscellaneous Functions
MySQL Functions
Improved MySQL Extension
Network Functions
Unified ODBC Functions
Object Aggregation/Composition Functions
Object property and method call overloading
OpenSSL Functions
Output Control Functions
PDF functions
PHP OptionsInformation
PostgreSQL Functions
Program Execution Functions
Session Handling Functions
Shared Memory Functions
SimpleXML functions
SQLite
Shockwave Flash Functions
Standard PHP Library (SPL) Functions
String Functions
URL Functions
Variable Functions
vpopmail Functions
XML Parser Functions
XML-RPC Functions
XSL functions
XSLT Functions

We would like to know if they are thread safe to a level which is suitable
for production environment.

3)Are there internal mechanisms in php for protecting thread safety (memory
leak, threads overwriting memory in use by another thread, blah, blah)?

We hope these questions are specific enough.
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-05 Thread Matthew Weier O'Phinney
* Symbulos Partners [EMAIL PROTECTED]:
 Richard Lynch wrote:
  If you re-read the previous emails from Rasmus, you will find that these
  questions are already answered within them.
  
  So I'm going to go on at length here telling you (again) what you don't
  want to hear.

 In my opinion, the answer some libraries are thread safe, some are not is
 generic. The answer the libraries in chapter VI. Function Reference of
 official PHP Manual version 03-01-2005 is specific. Now I think I
 understand the answer a bit better.

 We did not understand if you were talking about the libraries we develop,
 the libraries you develop, the libraries everybody else develops,
 commercial libraries, whatever library you can think of. Not
 all the libraries are indeed listed in the manual.

The thing is, the function sets listed in Section VI are not all 'core' PHP
-- in other words, if you were to do a vanilla install of PHP on a
machine, you wouldn't necessarily get all of these functions. Why?
Because most of the sets rely on... drum roll here... external
libraries. And it is the external libraries that PHP cannot guarantee
are threadsafe.

As an example of some function sets requiring external libraries:
snip
 2)Here is the list of the function sets we need to use, from Section VI

 Calendar Functions

Depends on libical

 CURL, Client URL Library Functions

Depends on libcurl

 Cyrus IMAP administration Functions

Depends on cyrus imap libraries

 DOM Functions
 DOM XML Functions

Depends on libxml

 Image Functions

Depends on GD, which has optional dependencies on libjpeg, libpng,
libungif...

 IMAP, POP3 and NNTP Functions

Depends on uw-imap cclient

 LDAP Functions

Depends on openldap libraries

I could keep going on, but hopefully you get the idea.

So, what Rasmus and Richard were saying is, if you can narrow down
*which* function sets you need and are compiling in to your PHP install,
you'll get a much better answer to the question of whether or not the
libraries you're utilizing with PHP are threadsafe. But just saying all
functions referenced in the manual is going to give you the answer,
probably not.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-04 Thread symbulos partners
Rasmus Lerdorf wrote:
 I thought I just explained that.  The problem is that the dozens of
 libraries you are likely to link into you Apache+PHP system may or may
 not be threadsafe.  

We are only thinking of using standard libraries,that is the libraries which
allow us to access the functions listed in chapter VI. Function Reference
of official PHP Manual version 03-01-2005.

Are these libraries all thread safe? If not, is there a list explaining
which libraries are thread safe (not thread safe)?

-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-04 Thread Richard Lynch
symbulos partners wrote:
 Rasmus Lerdorf wrote:
 I thought I just explained that.  The problem is that the dozens of
 libraries you are likely to link into you Apache+PHP system may or may
 not be threadsafe.

 We are only thinking of using standard libraries,that is the libraries
 which
 allow us to access the functions listed in chapter VI. Function Reference
 of official PHP Manual version 03-01-2005.

 Are these libraries all thread safe?

No.

 If not, is there a list explaining
 which libraries are thread safe (not thread safe)?

No.

If you re-read the previous emails from Rasmus, you will find that these
questions are already answered within them.

So I'm going to go on at length here telling you (again) what you don't
want to hear.

If you can narrow your focus down a bit from *ALL* of Section VI to *just*
the libraries you *really* need, you might get the answer you want to
hear: Oh, those are all thread-safe.

But there is NO WAY you'll hear that any time soon for *ALL* of Section VI.

There is no list of which ones are thread-safe -- Actually, it would be
virtually impossible to compile such a list.

It's more like a probability game.

We're pretty sure PHP and MySQL are thread-safe, because they are used so
extensively on so many high-volume sites that they'd have blown up already
if they were not thread-safe.

If you *HAD* to make a list, you'd be best started by listing the most
popular Modules, and assuming that the ones near the very top of the list
were probably thread-safe, and the ones near the bottom were most likely
not thread-safe (or, at least, completely untested for all practical
purposes)

But you're not going to find anybody willing to stake their reputation on
a list of what is or isn't thread-safe because there's NO WAY [*] to prove
it.

* Some computer scientist mathematician may have some algorithm to prove a
process thread-safe, but not in any practical sense that can be applied to
the real-life code that encompasses PHP.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread symbulos partners
Dear friends,

we would like to migrate a server where we host several websites (in virtual
hosting) to PHP 5 with Apache 2.

Technical support at the hosting provider told us there are still problems
about safety of threads on php 5 + Apache 2 (management of memory). They
would propose to migrate Apache to the pre-fork version in order to avoid
these problems (but we would be unable to use all the features of Apache
2). 

Is that right?

Has anybody switched to that combination already?

Any suggestion about recommended php, Apache versions?
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread Rasmus Lerdorf
symbulos partners wrote:
Dear friends,
we would like to migrate a server where we host several websites (in virtual
hosting) to PHP 5 with Apache 2.
Technical support at the hosting provider told us there are still problems
about safety of threads on php 5 + Apache 2 (management of memory). They
would propose to migrate Apache to the pre-fork version in order to avoid
these problems (but we would be unable to use all the features of Apache
2). 

Is that right?
Has anybody switched to that combination already?
Any suggestion about recommended php, Apache versions?
You want to stay away from the threaded MPM's in Apache2.
Which specific Apache2 features are you looking for?
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread symbulos partners
Rasmus Lerdorf wrote:
 You want to stay away from the threaded MPM's in Apache2.

Why?

-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread symbulos partners
Symbulos Partners wrote:

 Rasmus Lerdorf wrote:
 You want to stay away from the threaded MPM's in Apache2.
 
 Why?
 

Which versions would be recommended then? We would like to be able to use
the new PHP object model, and at the same time use features like the
possibility of running scriping languages using a lower rights users, as in
apache 2.
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread Rasmus Lerdorf
symbulos partners wrote:
Symbulos Partners wrote:

Rasmus Lerdorf wrote:
You want to stay away from the threaded MPM's in Apache2.
Why?

Which versions would be recommended then? We would like to be able to use
the new PHP object model, and at the same time use features like the
possibility of running scriping languages using a lower rights users, as in
apache 2.
How does Apache2 let you do that?
As far as threading goes, it is simply not a good idea for a large 
complex system.  There are too many moving parts to ensure that 
everything will be threadsafe.  Most of the parts are actually 
threadsafe, but the huge problem is that we don't have a clear picture 
of which libraries out there aren't, and it is nearly impossible to 
debug a thread-related race condition.  These race conditions tend to 
only happen under heavy load and only in certain conditions so they 
aren't reproducable which makes our job of tracking them down that much 
harder.  People have reported success with PHP under Apache2 with a 
threaded MPM so you can give it a try and see how it goes.  It may work 
perfectly, or it may work perfectly for weeks and then suddenly fall 
over.  Unless you really know what you are doing we are not going to be 
able to help you with any occasional crashes.

I am a big believer in keeping the base infrastructure as simple as 
possible.  You are going to layer a lot of complexity on top of Apache 
and PHP in the form of your web applications.  You want to make sure 
that your building blocks are rock solid so if you see a problem you can 
be confident that it is something you did wrong.  If your base is shaky 
everything you build on top of it is going to be that much more unstable.

-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread symbulos partners
Rasmus Lerdorf wrote:
 
 As far as threading goes, it is simply not a good idea for a large
 complex system. 


I do not understand why, probably because I am not well prepared. Can you
explain me? As far as I know, threading should be a noticeable improvement
in case of large systems. Is there something in the implementation of PHP 5
which does not allow for safe threading? If so, what it is?

 
 I am a big believer in keeping the base infrastructure as simple as
 possible.  You are going to layer a lot of complexity on top of Apache
 and PHP in the form of your web applications.  You want to make sure
 that your building blocks are rock solid so if you see a problem you can
 be confident that it is something you did wrong.  If your base is shaky
 everything you build on top of it is going to be that much more unstable.

I totally agree. Our problem is that we want to use the new php 5 object
model, and at the same time would like to move to Apache 2 for several
different reasons.

There are 4 alternative solutions

0)php 5 + Apache 2
1)php 5 + Apache 2 pre-fork (not totally satisfactory, but better than have
a  system that is unstable)
2)php 5 + Apache 1.3.33 (which is not totally satisfactory, less than 0,1 in
any case, but better than have a system that is unstable)
3)php 4 + Apache 2 (which is not totally satisfactory, less than 0,1,2 in
any case, better than have a system that is unstable)

which one does satisfy your condition of rock solid foundation? Or shall we
stick with php 4 + Apache 1.3.33, which is VERY unsatisfactory because we
cannot use the new object model?

The server is a production server, so we must have rock solid solutions on
it.

Thanks in advance.
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread Greg Beaver
Symbulos Partners wrote:
There are 4 alternative solutions
0)php 5 + Apache 2
1)php 5 + Apache 2 pre-fork (not totally satisfactory, but better than have
a  system that is unstable)
2)php 5 + Apache 1.3.33 (which is not totally satisfactory, less than 0,1 in
any case, but better than have a system that is unstable)
3)php 4 + Apache 2 (which is not totally satisfactory, less than 0,1,2 in
any case, better than have a system that is unstable)
which one does satisfy your condition of rock solid foundation? Or shall we
stick with php 4 + Apache 1.3.33, which is VERY unsatisfactory because we
cannot use the new object model?
The server is a production server, so we must have rock solid solutions on
it.
php5 + Apache 1.3.33 works just fine, have you tried that?  I would 
DEFINITELY wait until PHP 5.1 to put it into production though, there 
are a number of features being added, as well as the time spent testing 
and developing php 5 will help assure its stability as well.  If you 
have the possibility of setting up a test server on another port to test 
php5 with apache 1.3.33, this will be your safest bet to develop the 
software you will use without compromising the current setup.

You might also experiment with setting up Apache2 on another port, and 
then once you can be sure that your solution works in Apache and in 
Apache2, you have the ability to switch back to Apache in the blink of 
an eye just by modifying which port each process is listening to.  It 
would require maintaining parallel setups for a while, which is a real 
pain, but you would get the cutting-edge features you are looking for 
with a safety fallback, which your clients would be looking for.

Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread Matthew Weier O'Phinney
* Symbulos Partners [EMAIL PROTECTED]:
 Rasmus Lerdorf wrote:
  
  As far as threading goes, it is simply not a good idea for a large
  complex system. 


 I do not understand why, probably because I am not well prepared. Can you
 explain me? As far as I know, threading should be a noticeable improvement
 in case of large systems. Is there something in the implementation of PHP 5
 which does not allow for safe threading? If so, what it is?

My understanding is that not all of the libraries to which PHP links
have been tested with threads -- it's not a PHP issue, per se, but one
of PHP extensions. If you know for a fact that the libraries with which
you plan to compile PHP *are* threadsafe -- e.g., MySQL --  you're
probably okay; if not, better to stick with Apache2's prefork model or
stay with Apache1.

  I am a big believer in keeping the base infrastructure as simple as
  possible.  You are going to layer a lot of complexity on top of Apache
  and PHP in the form of your web applications.  You want to make sure
  that your building blocks are rock solid so if you see a problem you can
  be confident that it is something you did wrong.  If your base is shaky
  everything you build on top of it is going to be that much more unstable.

 I totally agree. Our problem is that we want to use the new php 5 object
 model, and at the same time would like to move to Apache 2 for several
 different reasons.

 There are 4 alternative solutions

 0)php 5 + Apache 2
 1)php 5 + Apache 2 pre-fork (not totally satisfactory, but better than have
 a  system that is unstable)
 2)php 5 + Apache 1.3.33 (which is not totally satisfactory, less than 0,1 in
 any case, but better than have a system that is unstable)
 3)php 4 + Apache 2 (which is not totally satisfactory, less than 0,1,2 in
 any case, better than have a system that is unstable)

 which one does satisfy your condition of rock solid foundation? Or shall we
 stick with php 4 + Apache 1.3.33, which is VERY unsatisfactory because we
 cannot use the new object model?

I *have* seen errors with PHP4 and Apache2, and I doubt these would be
any different with PHP5. However, where I work, we're developing on an
Apache2 prefork with PHP5, and performance is solid.

I did recently see a benchmark of PHP with Apache1 vs PHP with Apache2,
however, and it showed that the former outperformed the latter by 27 -
31%:

http://ilia.ws/archives/32-Apache-1-vs-Apache-2-Performance.html

If performance is less critical than features, then Apache2 will work
fine. 

I guess the big question is: are the features for which you want Apache2
available with the prefork model or not? If not, there's no benefit to
going to Apache2 -- and it might make more sense to run multiple
servers -- some with Apache1 and PHP5 and others running Apache2 and
whatever other modules you need.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread symbulos partners
We would really give preference to the possibility of using PHP 5, in order
to use the new object model.

Is Apache 1 + php 5 rock stable? How are performances?

-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread Rasmus Lerdorf
symbulos partners wrote:
Rasmus Lerdorf wrote:
As far as threading goes, it is simply not a good idea for a large
complex system. 
I do not understand why, probably because I am not well prepared. Can you
explain me? As far as I know, threading should be a noticeable improvement
in case of large systems. Is there something in the implementation of PHP 5
which does not allow for safe threading? If so, what it is?
I thought I just explained that.  The problem is that the dozens of 
libraries you are likely to link into you Apache+PHP system may or may 
not be threadsafe.  It doesn't have much to do with PHP itself.  If you 
are 100% certain that every library you plan on linking in is 
threadsafe, then go for it.  And there is no difference between PHP4 and 
PHP5 when it comes to a threaded Apache2, so your matrix there doesn't 
make much sense.  Either use Apache1 or Apache2-prefork if you want to 
make sure you have a robust system.  Then choose the version of PHP you 
prefer after that.

For my production servers I use Apache1 and PHP4 currently with new 
development being done on Apache1-PHP5.  I don't have anything that 
needs any of the features from Apache2.

-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.

2005-01-03 Thread Matthew Weier O'Phinney
* Symbulos Partners [EMAIL PROTECTED]:
 We would really give preference to the possibility of using PHP 5, in order
 to use the new object model.

 Is Apache 1 + php 5 rock stable? How are performances?

I have no benchmarks, but PHP5 has showed itself to be at least as
stable as PHP4 on Apache1 in the installations I've used; YMMV. Since
most of the applications we develop where I work are relatively
short-lived (i.e., execute in small fractions of a second), we haven't
noticed any notable performance differences.

For what it's worth, this is the combo that most PHP developers (those
writing the language) who bother to mention it report using. (Rasmus
Lerdorf just said this is what he uses on this very list.)

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php