Link to home
Start Free TrialLog in
Avatar of TaintedGod
TaintedGod

asked on

Installing PHP as an API or as CGI

I have an Apache server with php installed but i am not sure which way I should have it running, either as an API or as CGI.

Please tell me the pro's and con's.

Thanks.
Avatar of scully00000
scully00000

This is from the PHP install.txt

----------------

PHP 4 for Windows comes in two flavours - a CGI executable (php.exe),
and several SAPI modules (for exapmle php4isapi.dll). The latter form
is new to PHP 4, and provides significantly improved performance and
some new functionality. However, please note that the SAPI modules
are *NOT* yet considered to be production quality.
In particular, with the ISAPI module, you are likely to encounter serious
reliability problems especially on platforms older than W2K - you may
witness a lot of server 500 errors and suffer from other server modules
such as ASP also failing. You have been warned!

The reason for this is that the PHP SAPI modules are using the
thread-safe version of the PHP code, which is new to PHP 4, and has
not yet been tested and pounded enough to be considered completely
stable, and there are actually a few known bugs. On the other hand,
some people have reported very good results with the SAPI modules,
and there a few reports of problems with the Apache module version.
In short - your mileage may vary; If you need
absolute stability, trade the performance of the SAPI modules
with the stability of the CGI executable.

--------------

Basically, the API modules are still not considered 'production quality' i.e. doubts about their stability, BUT they're much faster than the CGI executable. If you need mission-critical stability, CGI, fast performance, API

Hope that helps
Avatar of TaintedGod

ASKER

I believe that should be enough but I heard that there are some functions and scripts and stuff that dont work with one or the other, i wanted to know which one is more portable.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of scully00000
scully00000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Then i shall stick with CGI. Thanks.
TaintedGod

Thanks for the points. Out of interest, why the CGI version?

Cheers again
Well under phpinfo() it says fast CGI and I am using windows so the more stable the better.
Fair enough. Good luck.