php under FastCGI

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Problem: If you need to run regular php scripts under FastCGI, saving
on the overhead of fopen'ing and reading in the contents before
executing each time, in theory I guess you'd put a FastCgiServer
directive in your httpd.conf, and direct it to some sort of app (could
be written in C or anything) that loads and keeps in memory all your
php files from your site, and runs their contents when a url request
comes in for that file. Does such an app exist?

Re: php under FastCGI

On 21 Jan, 10:18, wrote:
Quoted text here. Click to load it

Yes - a ramdisk. But if you're using a sensible operating system it
will be cached anyway.

But more sensibly, a PHP accelerator will go even further by caching a
tokenized version of the script


Re: php under FastCGI

On 1月21日, 下午9时17分, "C. (http://symcbean.blogsp"
Quoted text here. Click to load it

Cool, thanks.
One thing: I'm using (from the sapi/cgi/php-cgi) and running my apps
instead of mod_php from apache, and it's not recognizing the mysql
functions. From strace I realized it wasn't finding php.ini, so I sym-
linked the correct one to where it was trying to look for it (/usr/
local/lib/php-cgi-fcgi.ini). Looks like it's finding it now, but still
not loading mysql - normally the mod_php executes /etc/php5/apache2/
php.ini and I guess at some point also executes the ones in /etc/php5/
conf.d, which are just 1 line each telling it to
or whatever the module is. I dumped the contents of all of these into /
etc/php5/fcgi/php.ini and set:

extension_dir = "/usr/lib/php5/20060613/"

which is where they are. How to get the sapi cgi php binary to load
the mysql and other modules correctly to use in running apps?


Site Timeline