writing php scripts for fastcgi environments [message #173286] |
Fri, 01 April 2011 18:09 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
Hi
Bit of a conundrum.
The commercial linux hosting that a website uses has some sort of fastcgi
implementation that handles the php scripts. I've looked several times,
but my google fu is failing. I can find plenty of discussion relating to
fastcgi configuration, and using fastcgi on IIS etc, but I'm struggling
to find any suggestions or recommendations on optimising php scripts that
will be running in a fastcgi environment.
Are there dos and don'ts for php in a fastcgi environment, over and above
normal coding practices, or is fastcgi irrelevant at the level of writing
the script?
Rgds
Denis McMahon
|
|
|
|
Re: writing php scripts for fastcgi environments [message #173293 is a reply to message #173286] |
Fri, 01 April 2011 23:12 |
Michael Vilain
Messages: 88 Registered: September 2010
Karma: 0
|
Member |
|
|
In article <4d9614d0$0$14967$bed64819(at)gradwell(dot)net>,
Denis McMahon <denis(dot)m(dot)f(dot)mcmahon(at)gmail(dot)com> wrote:
> Hi
>
> Bit of a conundrum.
>
> The commercial linux hosting that a website uses has some sort of fastcgi
> implementation that handles the php scripts. I've looked several times,
> but my google fu is failing. I can find plenty of discussion relating to
> fastcgi configuration, and using fastcgi on IIS etc, but I'm struggling
> to find any suggestions or recommendations on optimising php scripts that
> will be running in a fastcgi environment.
>
> Are there dos and don'ts for php in a fastcgi environment, over and above
> normal coding practices, or is fastcgi irrelevant at the level of writing
> the script?
>
> Rgds
>
> Denis McMahon
I can't speak to the exact implementation of fastcgi, but cgi in general
forks a process to run a shell that executes the program. Here's some
discussion on fastcgi
http://www.fastcgi.com/drupal/node/6?q=node/15
You can run php scripts either directly as threads within the memory
space of the web server (usually Apache). This is the mod_php
implementation and must run on the same machine as the Apache server.
Or you can run the script as a separate process either on the local
machine with the web server or on another machine.
What's your specific concern here? AFAIK from the above page, you write
a script and it will run via CGI or on a fastcgi implementation
unchanged.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]
|
|
|
Re: writing php scripts for fastcgi environments [message #173295 is a reply to message #173293] |
Sat, 02 April 2011 00:17 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 4/1/2011 7:12 PM, Michael Vilain wrote:
> In article<4d9614d0$0$14967$bed64819(at)gradwell(dot)net>,
> Denis McMahon<denis(dot)m(dot)f(dot)mcmahon(at)gmail(dot)com> wrote:
>
>> Hi
>>
>> Bit of a conundrum.
>>
>> The commercial linux hosting that a website uses has some sort of fastcgi
>> implementation that handles the php scripts. I've looked several times,
>> but my google fu is failing. I can find plenty of discussion relating to
>> fastcgi configuration, and using fastcgi on IIS etc, but I'm struggling
>> to find any suggestions or recommendations on optimising php scripts that
>> will be running in a fastcgi environment.
>>
>> Are there dos and don'ts for php in a fastcgi environment, over and above
>> normal coding practices, or is fastcgi irrelevant at the level of writing
>> the script?
>>
>> Rgds
>>
>> Denis McMahon
>
> I can't speak to the exact implementation of fastcgi, but cgi in general
> forks a process to run a shell that executes the program. Here's some
> discussion on fastcgi
>
> http://www.fastcgi.com/drupal/node/6?q=node/15
>
> You can run php scripts either directly as threads within the memory
> space of the web server (usually Apache). This is the mod_php
> implementation and must run on the same machine as the Apache server.
>
> Or you can run the script as a separate process either on the local
> machine with the web server or on another machine.
>
> What's your specific concern here? AFAIK from the above page, you write
> a script and it will run via CGI or on a fastcgi implementation
> unchanged.
>
Yes and no. There are differences between running PHP as a mod and CGI,
mainly in the $_SERVER array. Scripts running under mod_php will not
necessarily run under fastcgi. You need to check the doc.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|