indeyets/appserver-in-php

What next?

LarryEitel opened this issue · 8 comments

I have installed appserver-in-php and started the appserver per instructions.

root@AIP:/var/www/html/aip# ./bin/aip app examples/new/aip.yaml
Loading configuration…
[app+] MyApp server via HTTP at tcp://127.0.0.1:8080. (5-10 workers)
[app+] MyApp server via SCGI at tcp://127.0.0.1:9999. (1-2 workers)
Starting workers…

I have hit the URL:
http://x.x.x.x/aip/examples/new/template.html

I have tried entering various inputs. No indication of anything functioning or results returned.

What next?

Thank You

OK, progress! We discovered that in examples / scgi_client.php we had to adjust paths to correctly point to: autoload.php

Here is a current cat of the file:

<?php

print "<h1>proof</h1>\n";

require __DIR__.'/../vendor/autoload.php';

print "<h2>required</h2>\n";
$client = new \AiP\Protocol\SCGI\Client('tcp://127.0.0.1:9999');
$req = new \AiP\Protocol\SCGI\ClientRequest($client);
print "<h2>constructed</h2>\n";

$req->setURI('/');
print "<h2>set URI</h2>\n";
$req->setMethod('GET');
print "<h2>set method get</h2>\n";
var_dump($req->send());
print "<h2>sent</h2>\n";

$req->setMethod('POST');
print "<h2>set method post</h2>\n";
$req->addPostParameter('abc', 'def');
print "<h2>added post parameter</h2>\n";
$req->addPostParameter('ghi', 'jkl');
print "<h2>added post parameter</h2>\n";

var_dump($req->send());
print "<h2>sent</h2>\n";

After aip is started:
Hit: /aip/examples/scgi_client.php

Watch logger output. May need to adjust other directories as well.

just point your browser to http://127.0.0.1:8080/

Basically, we cloned this project and after installing via composer, we hit /aip/examples/scgi_client.php to test. I am just getting familiar with the role an appserver can play. So basically, the scgi_client demonstrates how to interact with AIP.

@LarryEitel right. client is for testing/proxying. anyway, HTTP-mode is considered more robust right now. SCGI support is not actively tested

Well, I hit the <IP>:8080 and that didn't work. Apache is also intercepting traffic. However, we were able to, after hacking dir's, to get /aip/examples/scgi_client.php to interact with AIP. I ran the example app while AIP was running however, it wasn't clear how it was intended to work/demonstrate AIP interaction.

well… if Apache is on 8080 you need to set different port in aip.yaml for HTTP.
web-server is started on this port (please note, that it starts on 127.0.0.1, not on a public IP)

@indeyets, do you happen to have it running somewhere so that I can see it work?