# Php app on Open Ondemand

**URL:** <https://discourse.openondemand.org/t/php-app-on-open-ondemand/1192>\
**Category:** Get Help\
**Tags:** question\
**Created:** [November 2, 2020, 8:56pm UTC](https://discourse.openondemand.org/t/php-app-on-open-ondemand/1192 "2020-11-02T20:56:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fangpingmu](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/fangpingmu/32/532_2.png) [@fangpingmu](https://discourse.openondemand.org/u/fangpingmu)\
**Post date:** [November 2, 2020, 8:56pm UTC](https://discourse.openondemand.org/t/php-app-on-open-ondemand/1192/1 "2020-11-02T20:56:33Z")

</div>

> [@OnDemand 2.x Roadmap: Scalability Goals](https://discourse.openondemand.org/t/ondemand-2-x-roadmap-scalability-goals/294):
>
> Below is a list of “scalability goals” for the OnDemand 2.x five year project. The first year’s focus will be on these three goals, though other goals may also be addressed. Extendibility: Interactive work without a batch scheduler Extendibility: Increase number of languages to build and deploy apps in Performance: Reduce response times, start up times, memory usage Please comment if you see something missing that should be included here, or if you think our prioritization is incorrect. Exte…

“Increase number of languages to build and deploy apps in. OnDemand web apps are limited to apps written in Ruby, Python and Node. We want to extend this to other languages like PHP and Java.”

I am bringing up a web application thorough Passenger app or batch connect (interactive) app. The Web application is written in php + java script. In Open Ondemand roadmap, ondemand 2.0 will support PHP and Java. Is OSC already supporting PHP? Can you share the methods to use PHP through Passenger app or interactive app?

Thank you!

---

<div class="post-metadata">

**Author:** ![efranz](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/efranz/32/27_2.png) [@efranz](https://discourse.openondemand.org/u/efranz)\
**Post date:** [November 2, 2020, 9:48pm UTC](https://discourse.openondemand.org/t/php-app-on-open-ondemand/1192/2 "2020-11-02T21:48:44Z")

</div>

If you want to have an interactive app written PHP where the web app is made available to launch in OnDemand through an “interactive app plugin”, whose sessions are started by users typically through a batch job, then you can use any language as long as you understand how to start that web server. There are several challenges with this:

1. If the web app generates non-relative URLs in its HTML responses, you need to be able to configure the web app to know about the suburi it will be served from, which is created dynamically during job submission
2. You need to configure some type of authentication for the app. If the app doesn’t support it by default you could stick a sidecar proxy in front to provide that authentication. We did that to [launch an R Shiny app](https://github.com/OSC/bc_osc_example_shiny) and there is an example of providing an [authenticating proxy for using Tensorboard from Stanford RC](https://github.com/stanford-rc/sh_ood-apps/tree/default/sh_tensorboard).

If you are interested in launching web apps on the OnDemand web-host on-demand, similar to how the dashboard, files, shell, job composer, and active jobs apps launch, that is what this Scalability goal refers to with “extending the number of languages supported”.

For this, I’ve experimented using [Passenger Generic Language Support](https://www.phusionpassenger.com/docs/advanced_guides/gls/) within OnDemand to launch an app written in Go, and at OSC we are successfully using Passenger GLS outside of OnDemand to launch Shiny R apps in production.

The issue with GLS as it relates to OnDemand is that it starts the web processes listening on a TCP socket instead of an IPC socket like Passenger does with Ruby, Python, and NodeJS so that creates a security issue that we need to first solve. We are talking about placing the PUN in a container for 2.0 to solve this, but we haven’t done that yet.

After that is done, I imagine we would modify nginx\_stage so that if a `bin/passenger_app_start` exists, then we add a [config for GLS](https://www.phusionpassenger.com/docs/references/config_reference/nginx/#passenger_app_start_command) that looks something like:

```
copy passenger_app_start_command "/path/to/app/bin/passenger_app_start $PORT";

```

So for PHP you would need a web server that can serve that app, and then Passenger would launch that app using the provided command.

---

<div class="post-metadata">

**Author:** ![fangpingmu](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/fangpingmu/32/532_2.png) [@fangpingmu](https://discourse.openondemand.org/u/fangpingmu)\
**Post date:** [November 2, 2020, 10:42pm UTC](https://discourse.openondemand.org/t/php-app-on-open-ondemand/1192/3 "2020-11-02T22:42:44Z")

</div>

Thank you very much for these detailed explanations.

I already deployed R shiny server through batch connect. You are recommending this shiny server [https://github.com/OSC/bc\_osc\_example\_shiny](https://github.com/OSC/bc_osc_example_shiny), while I am using [https://github.com/OSC/bc\_rshiny](https://github.com/OSC/bc_rshiny) Is my understanding correct that this rshiny does not provide a sidecar proxy in front to provide the authentication?

I will explore the tensor board implementation.

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:43pm UTC](https://discourse.openondemand.org/t/php-app-on-open-ondemand/1192/4 "2022-05-26T15:43:04Z")

</div>

Closed on May 26, 2022, 3:43pm UTC


