View Single Post

  #5 (permalink)  
Old 02-27-2008
Jerry Stuckle
 
Posts: n/a
Default Re: Is fast-cgi a drop-in replacement for mod_php?

Evil Son wrote:
>> Evil Son:
>>> Essentially, my question is: is fast-cgi a drop-in replacement for
>>> mod_php?

>
> Jerry Stuckle:
>> Pretty much. But nothing will give you the behavior you're looking for.
>> The web is by nature transactional, and all languages act the same way
>> - scripts are initialized when you call them and do not carry over
>> values or connections from previous executions.

>
> Quite the contrary, I was hoping it behaved much like mod_php for code
> compatibility and simplicity.
>
> I must admit though that this behaviour is surprising since part of
> the reason for fastcgi (as I understood it anyway) was to maintain
> state/resources across requests - e.g. an open database connection.
> It seems that PHP in fastcgi mode doesn't ... and I'm quite happy with
> that as it avoids a whole class of bugs.
>
> Thanks!
>
>


Not at all. Fastcgi just keeps the module in memory so it doesn't have
to be loaded and initialized every time.

Think about it - what happens if the last time the particular script was
called it was a different user? You wouldn't want someone else to get
access to your bank account!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote