THRIFT-405. php: Create a tutorial server
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758528 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tutorial/php/runserver.py b/tutorial/php/runserver.py
new file mode 100755
index 0000000..d24efd5
--- /dev/null
+++ b/tutorial/php/runserver.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+import os
+import BaseHTTPServer
+import CGIHTTPServer
+
+# chdir(2) into the tutorial directory.
+os.chdir(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
+
+class Handler(CGIHTTPServer.CGIHTTPRequestHandler):
+ cgi_directories = ['/php']
+
+BaseHTTPServer.HTTPServer(('', 8080), Handler).serve_forever()