Results 1 to 4 of 4
  1. #1

    differences between PHP Server APIs?

    Hi,

    I've been looking for a provider to install a PHP app and i'm noticing quite a few different configurations.

    e.g. (from phpinfo() - SERVER API)

    * FCGI (fast-cgi)
    * CGI
    * Apache

    Here's my thoughts on each of these approaches. I would appreciate any clarification or correction:

    Apache: PROs: Fast, supports features like "mod_rewrite" (for seach engine friendly urls), persistent db connections.
    Cons: security concerns? (e.g. reading other users files) bad app can crash webserver (?)

    CGI: PROs: secure. hard to crash server.
    CONS: slow, no persisent DB connections

    FCGI: PROs: faster than CGI, persisent db connections (?)
    CONS: can't use mod_rewrite, slower than Apache API (?)

    Any thoughts? I would love to have "Apache API", but many sites seem to use the FCGI (godaddy) and CGI (hostingzoom).

    Regards,

    JASON

  2. #2
    Join Date
    Oct 2004
    Location
    Brisbane, Australia
    Posts
    259
    If you were looking at FastCGI i would recommend going with Lighttpd as the web server.

    It is quite an impressive little webserver and you can even run it side by side with apache if you enable ProxyPass in your httpd.conf.

  3. #3

    Re: differences between PHP Server APIs?

    Apache: PROs: Fast, supports features like "mod_rewrite" (for seach engine friendly urls), persistent db connections.
    Cons: security concerns? (e.g. reading other users files) bad app can crash webserver (?)
    Another PRO: mod_php can change PHP configurations from .htaccess.

    CGI: PROs: secure. hard to crash server.
    CONS: slow, no persisent DB connections

    FCGI: PROs: faster than CGI, persisent db connections (?)
    CONS: can't use mod_rewrite, slower than Apache API (?)
    Antoher CON: Both cannot change PHP configuration from .htaccess.

    FCGI could be faster than Apache API, and mod_rewrite can be used with it as well, so your CONS about FCGI is not right. The real problem for FCGI is security. It may be more vulnerable for shared hosting if one global FCGI PHP is used for all accounts, worse than mod_php, as you can't set "open_basedir" for each account. Stay away from FCGI if you plan to host multiple accounts, at least for Apache.

    We are developing our own PHP SAPI, which has all above pros.

    George Wang
    LiteSpeed Web Acceleration Platform by http://www.litespeedtech.com
    Apache drop-in replacement. Triple server capacity with 10X performance increases.
    Ultimate web serving platform for WordPress, Magento and other web applications.
    Turbo charging all WordPress sites hosted on your server with a single click!

  4. #4
    I was wrong about FCGI not supporting mod_rewrite. (I guess the apache app handles this completely so it really has nothing to do with FCGI. I was misled because I didn't see mod_rewrite in phpinfo())

    So, I was able to add RewriteRules into .htaccess with an FCGI php setup. (I haven't tested peristent db connections yet.)

    Also, Hostingzoom (CGI) sent me an email saying that they support mod_rewrite. (unverified)

    -Jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •