An example PHP-WSGI app:
<?php
require_once 'php-wsgi.php';
run_with_cgi(function($environ, $start_response) {
try {
$start_response('200 OK', array('Content-Type' => 'text/plain'));
return array("Hello World\n");
} catch (Exception $e) {
$start_response(
'500 Oops',
array('Content-Type' => 'text/plain'),
$e
);
return array('Return error body');
}
});