Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Installing PHP as an API or as CGI

Posted on 2003-10-28
7
Medium Priority
?
339 Views
Last Modified: 2006-11-17
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.
0
Comment
Question by:TaintedGod
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 2

Expert Comment

by:scully00000
ID: 9641180
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
0
 
LVL 2

Author Comment

by:TaintedGod
ID: 9644918
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
0
 
LVL 2

Accepted Solution

by:
scully00000 earned 500 total points
ID: 9649099
TaintedGod

Any script should theoretically work with the API or the CGI. The only time they don't is if you write a script containing PHP functions from a library that isn't usually included with the production release (for example, PDFLib which allows PHP to write PDFs). However, if you are using these kind of functions you will have to check any webserver you deploy the script on - regardless of whether it's using CGI or API.

Hope that helps

Cheers
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:TaintedGod
ID: 9653216
Then i shall stick with CGI. Thanks.
0
 
LVL 2

Expert Comment

by:scully00000
ID: 9653691
TaintedGod

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

Cheers again
0
 
LVL 2

Author Comment

by:TaintedGod
ID: 9660480
Well under phpinfo() it says fast CGI and I am using windows so the more stable the better.
0
 
LVL 2

Expert Comment

by:scully00000
ID: 9660721
Fair enough. Good luck.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question