Crossbar.io and PHP-CGI

#1

I use Apache or nginx to server PHP scripts. Then I decided to implement some RT communication with Crossbar.io ( I did that by using python or php/thawte ).

Is it possible to forward scripts to php5-cgi or is this meant only for Python CGI scripts ? My goal is to use crossbar.io as only serving platform.

0 Likes

#2

Ok, I figured it out. I can use php as CGI :
“script”: {
“type”: “cgi”,
“directory”: “…/cgi”,
“processor”: “/usr/bin/php”
}

``

Problem was that I didn’t specified headers.

<?php echo "Content-Type: text/html\n\n"; echo "Hello World"; ?>

``

Well okay, now I still have to implement the whole serving mechanism :slight_smile: like rewrites if I want to use some php mvc. Any suggestions ?

···

On Tuesday, May 19, 2015 at 2:28:03 PM UTC+2, Gregor Pohajac wrote:

I use Apache or nginx to server PHP scripts. Then I decided to implement some RT communication with Crossbar.io ( I did that by using python or php/thawte ).

Is it possible to forward scripts to php5-cgi or is this meant only for Python CGI scripts ? My goal is to use crossbar.io as only serving platform.

0 Likes

#3

Hi Gregor,

sorry for the sluggish response (I missed this thread).

As you already found out yourself, yes, you can use any CGI compatible “thing”, which includes PHP.

Well okay, now I still have to implement the whole serving mechanism :slight_smile: like rewrites if I want to use some php mvc. Any suggestions ?

To be honest, I don’t understand the question. What “serving mechanism”?

PHP behind Crossbar.io via CGI works “the same” (in principle) as PHP behind Apache. There isn’t any magic added or remove … it’s just CGI.

But likely I just don’t get what you are asking for?

Cheers,
/Tobias

···

Am Dienstag, 19. Mai 2015 14:44:59 UTC+2 schrieb Gregor Pohajac:

Ok, I figured it out. I can use php as CGI :
“script”: {
“type”: “cgi”,
“directory”: “…/cgi”,
“processor”: “/usr/bin/php”
}

``

Problem was that I didn’t specified headers.

<?php echo "Content-Type: text/html\n\n"; echo "Hello World"; ?>

``

Well okay, now I still have to implement the whole serving mechanism :slight_smile: like rewrites if I want to use some php mvc. Any suggestions ?

On Tuesday, May 19, 2015 at 2:28:03 PM UTC+2, Gregor Pohajac wrote:

I use Apache or nginx to server PHP scripts. Then I decided to implement some RT communication with Crossbar.io ( I did that by using python or php/thawte ).

Is it possible to forward scripts to php5-cgi or is this meant only for Python CGI scripts ? My goal is to use crossbar.io as only serving platform.

0 Likes