By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

php accelerator that works in cgi mode?

P: n/a
I am looking for an open source php accelerator that works in cgi mode. I
am guessing that to do that the cache would have to be on disk and not in
memory. I was looking at the turk accelerator (since it will cache to
disk), but it says somewhere that it will not work in cgi mode. I am
almost tempted to try it though.

Ideas? BTW my platform is linux.
Jul 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
KAH
"Nick Bartos" <sp**@2thebatcave.com> wrote in
news:pa****************************@2thebatcave.co m:
I am looking for an open source php accelerator that works in cgi
mode. I am guessing that to do that the cache would have to be on
disk and not in memory. I was looking at the turk accelerator (since
it will cache to disk), but it says somewhere that it will not work in
cgi mode. I am almost tempted to try it though.

Ideas? BTW my platform is linux.


I doubt you'll find such a product. Why do you run in CGI mode anyway? It's
insecure, slow and has less functionality. Run it as an Apache module.

KAH
Jul 16 '05 #2

P: n/a
actually the very reason I run it is for security.

I need to have php run as separate users for separate websites (so some
users can't screw with other users stuff). The only way I see to do this
is doing it through a cgi, or possibly doing an apache2 module using the
per-child mpm. However I don't want to go with apache2 and the per-child
mpm since it hasn't been tested that well.

And actually I don't run it as a cgi technically, I just use the cgi
executable. I have the .php, .php3, and .php4 extensions registered in
the linux kernel for a misc binary format, which allows all of the files
with that extension to be executed just like any other binary file (from
the web server or from the command line). This way the php binary is not
visable at all from the outside, so it is very secure in that reguard.
Also it gets around having to put the #! at the beginning of all the php
files.

If I could find a way to get apache suexec to work with php compiled as a
module in 1.3.x, I would be more than happy to switch. If there is some
way to do this please let me know. That would definately be a move in the
right direction for performance, but I can't sacrafice the security at
this point.

I doubt you'll find such a product. Why do you run in CGI mode anyway? It's
insecure, slow and has less functionality. Run it as an Apache module.

KAH


Jul 16 '05 #3

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nick Bartos whispered unto us in comp.lang.php:
actually the very reason I run it is for security.
I need to have php run as separate users for separate websites (so
some users can't screw with other users stuff). The only way I see to
do this is doing it through a cgi, or possibly doing an apache2 module
using the per-child mpm. However I don't want to go with apache2 and
the per-child mpm since it hasn't been tested that well.


Run it as apache 1.3 module, in secure mode? Works well for me, at
least.
- Vid `RTFM` Strpic.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/PNPMq1AzG0/iPGMRAihmAKCpkEERaC5xjUug4LCZ/4CjMbGDjwCeMD6n
KEFX01hZIlA1478eUMBqjA8=
=5cCQ
-----END PGP SIGNATURE-----

--
vm*@bofhlet.net, IRC:*@Martin, /bin/zsh. C|N>K
Linux moria 2.4.21 #1 Sat Jul 5 16:11:20 CEST 2003 i686
14:35:32 up 25 days, 23:20, 8 users, load average: 0.20, 0.12, 0.12
Jul 16 '05 #4

P: n/a
It looks like the solution is to use the apc cache with fastcgi (and a
slightly modified suexec).

After doing some crude bench testing, I came up with the cgi mode taking
1.6 times as long to process 400 requests (50 concurrently) on large (28K
lines) files. On small files (less than 10 lines), cgi mode took over 10
times longer. That of course is not good.

After implementing fastcgi and a modified suexec (to skip the owner/group
checks so I could get away with just one copy of the php binary), cgi mode
was fairly close to using mod_php statically in the httpd binary. The
average times for cgi were still a little slower, but the max times were
better than doing the module.

After implementing apc built statically into the php binary, the numbers
changed drastically. using that setup, cgi was now over 10x faster than
doing a module for the large files, and a bit better with smaller files
too.

As far as performance and security it looks like this will work well. Now
the test will be time in making sure that it ends up being stable...

On Thu, 14 Aug 2003 08:04:43 -0500, Nick Bartos wrote:
I am looking for an open source php accelerator that works in cgi mode.
I am guessing that to do that the cache would have to be on disk and not
in memory. I was looking at the turk accelerator (since it will cache
to disk), but it says somewhere that it will not work in cgi mode. I am
almost tempted to try it though.

Ideas? BTW my platform is linux.

Jul 16 '05 #5

P: n/a
Hello,

On 08/14/2003 10:04 AM, Nick Bartos wrote:
I am looking for an open source php accelerator that works in cgi mode. I
am guessing that to do that the cache would have to be on disk and not in
memory. I was looking at the turk accelerator (since it will cache to
disk), but it says somewhere that it will not work in cgi mode. I am
almost tempted to try it though.

Ideas? BTW my platform is linux.


AFAIK, you can tell Turck to stored compiled scripts in disk. When it
says it does not work in CGI mode, it means it will not cache the
compiled files in shared memory because those caches would be lost upon
script ending.

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.