Request for input : What makes most sense in *your* PHP environment?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bjarne

    Request for input : What makes most sense in *your* PHP environment?

    Dear all,
    although being a user of PHP and other scripting-languages for years, I
    have not taken part in any large projects based on PHP. Thus, I don't
    really know how real PHP-applications are deployed out there. This
    posting is a request for input from professional PHP-users and
    architects with experience from designing PHP applications.

    My company makes a toolkit for developing WebServices. This toolkit is
    typically used to expose an API to existing applications. i.e. exposing
    (parts of) an existing application as a WebService. The server-part of
    this toolkit is implemented in Java and currently requires the
    user-application also to be implemented in Java (running inside a
    container of the users choice or standalone, if desired). The toolkit
    can generate client-code for PHP - see http://www.smodl.org/ if you're
    interested in more details.

    One of our goals is to make the server-part of our toolkit work in a
    LAMP stack, allowing the user-application to be written in e.g. PHP.
    Running it on a MS platform with IIS and PHP may be a secondary result,
    but it is not the primary goal. We would, for obvious reasons, like to
    re-use the proven server-part of the toolkit, which is written in Java.
    This suggests using some way to bridge PHP and Java. I understand that
    such bridges exists, but first there is the question of architecture :
    How should these components interact?

    These are the three different scenarios we are currently investigating
    :

    Scenario 1 : Let a servlet-container (e.g. Tomcat) be the front-end of
    the WebService, running the toolkit server-part as a servlet. The
    servlet would perform toolkit-tasks and then call the appropriate
    methods in the user-application written in PHP. I imagine the SAPI
    module would handle this. Pro : SAPI seems to be recommended on php.net
    as a robust and efficient solution. Con : replacing apache as the
    front-end might not be desireable?

    Scenario 2 : Let a http-server (e.g. Apache) be the front-end of the
    WebService, primarily invoking a PHP-script. This PHP-script would
    bridge to the toolkit server-part to perform toolkit-tasks, and then
    call the appropriate methods in the user-application. The PHP-Java
    bridge should be able to handle this. Pro : Apache remains the
    frontend, user-control over the primary entry-point. Con :
    availability, stability and performance of the PHP-Java bridge?

    Scenario 3 : Let a http-server (e.g. Apache) be the front-end of the
    WebService, primarily invoking a cgi-bin. The cgi would essentially
    wrap the standalone toolkit server-part which would perform toolkit
    tasks and then call the appropriate methods in the user-application
    written in PHP. The SAPI module should be able to handle this. Pro :
    Apache remains the frontend, SAPI seems to be recommended as robust and
    efficient solution on php.net. Con : startup-time?

    As briefly indicated above, these scenarios have different pros and
    cons. But which one makes most sense and would fit most seamlessly into
    your PHP production-environment? Have I possibly missed some obvious
    points? Or are there other scenarios which would make more sense?

    Thanks in advance for your time!

    Best regards,
    - Bjarne

  • Colin McKinnon

    #2
    Re: Request for input : What makes most sense in *your* PHP environment?

    Bjarne wrote:
    although being a user of PHP and other scripting-languages for years, I
    have not taken part in any large projects based on PHP. Thus, I don't
    really know how real PHP-applications are deployed out there. This
    posting is a request for input from professional PHP-users and
    architects with experience from designing PHP applications.
    >
    My gut reaction would be to keep them quite seperate - or at least have the
    PHP running in the front end rather than the back end. But a quick browse
    through the comments on the PHP/Java integration page
    (http://uk.php.net/manual/en/ref.java.php) suggests that both methods of
    direct integration are far from stable/fast.

    So I would go with scenario 3; combining well understood, stable and
    scalable methods for implementing Java and for implementing PHP.

    I'm not quite clear why the user application has to be written in Java
    unless the toolkit becomes part of the runtime.

    C.

    Comment

    • peter

      #3
      Re: Request for input : What makes most sense in *your* PHP environment?

      Hello!
      (http://uk.php.net/manual/en/ref.java.php) suggests that both methods of
      Nuke this link. There's no java support since php 5.0, they have
      removed the experimental php 4 java extension but kept the web page.

      But running the java bridge from Zend or from sourceforge.net within
      Geronimo or Apache/Tomcat is quite fast and very reliable.

      Comment

      Working...