473,383 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

php under FastCGI

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?
Jan 21 '08 #1
2 1428
On 21 Jan, 10:18, drblitzkr...@gmail.com wrote:
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?
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

C.
Jan 21 '08 #2
On 1ÔÂ21ÈÕ, ÏÂÎç9ʱ17·Ö, "C. (http://symcbean.blogspot.com/)"
<colin.mckin...@gmail.comwrote:
On 21 Jan, 10:18, drblitzkr...@gmail.com wrote:
Problem: If you need to run regularphpscriptsunderFastCGI, 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
phpfiles from your site, and runs their contents when a url request
comes in for that file. Does such an app exist?

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

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

C.
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 extension=mysqli.so
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?

Thx.
Jan 23 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Henri Vilminko | last post by:
I installed the Zend PHP enabler for Sun ONE Web Server which is basically a wrapper to run PHP in fastcgi mode. The interpreter runs fine but there's one nasty problem: PHP doesn't use the PHPRC...
1
by: Adam Szendzielorz | last post by:
Hello! I'm searching patch for Apache SuEXEC (1.3.*) which get me gate to work PHP (compiled with --enable-fastcgi) with mod_fastcgi. SuEXEC check owner/group of script before run script, i...
4
by: Peter Otten | last post by:
Is there a way to limit both width and height of a canvas text item? My current workaround seems clumsy: import Tkinter as tk root = tk.Tk() canvas = tk.Canvas(root, width=400, height=200,...
0
by: venkatbo | last post by:
Hi folks, I'm trying to get lighttpd, fastcgi & python working on a 2.4.21.x i686 linux system. I tried following the steps in: ...
5
by: howachen | last post by:
hi, which package you perfer? mod_php on apache is okay but some people said fastcgi version of php is faster, is it true? thanks...
37
by: Joshua Ruppert | last post by:
When I'm using FastCGI do I need to code differently than I do when using regular CGI? Because the PHP.exe processes don't go away do global variables stick around from page request to page...
7
by: Vincent Delporte | last post by:
Hello I'm interested in hearing reflections by seasoned web app developpers about the different ways to write PHP apps, and especially how they compare in terms of performance, whether it's the...
2
by: Sanders Kaufman | last post by:
I'm working on a webhost that seems to have an undocumented feature. I inadvertently coded a link to "mydomain.com//" - with TWO trailing slashes. When I clicked the link, Apache returned this...
2
by: FastCGI | last post by:
I must admit, I am somewhat ignorant when it comes to understanding FastCGI at this point, but all I do know is that it is the only way to implement dynamic web pages using C++ that compete on the...
1
by: Ivan Voras | last post by:
Hi, Is there a straightforward way to convert an XML-RPC server application (written for SimpleXMLRPCServer) to use WSGI so that it can be used as s fastcgi server? By "straightforward" I mean...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.