FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » writing php scripts for fastcgi environments
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
writing php scripts for fastcgi environments [message #173286] Fri, 01 April 2011 18:09 Go to next message
Denis McMahon is currently offline  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 #173288 is a reply to message #173286] Fri, 01 April 2011 18:31 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
On Apr 1, 7:09 pm, Denis McMahon <denis.m.f.mcma...@gmail.com> wrote:
> or is fastcgi irrelevant at the level of writing
> the script?

That's pretty much it.
Re: writing php scripts for fastcgi environments [message #173293 is a reply to message #173286] Fri, 01 April 2011 23:12 Go to previous messageGo to next message
Michael Vilain is currently offline  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 Go to previous message
Jerry Stuckle is currently offline  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
==================
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: relative v. absolute paths
Next Topic: Posting and redirecting to remote script
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 13:20:17 GMT 2024

Total time taken to generate the page: 0.03042 seconds