It was suggested to me in answer to my question How can I use Python’s CGIHTTPRequestHandler as a dev server for PHP that I try WPHP.
I've tried:
import wphp
my_php_app = wphp.PHPApp('/path/to/php-files/')
from paste import httpserver
httpserver.serve(my_php_app)
But no matter what I request in the browser, I get:
Exception happened during processing of request from ('127.0.0.1', 49397)
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 1068, in process_request_in_thread
self.finish_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 615, in __init__
self.handle()
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 442, in handle
BaseHTTPRequestHandler.handle(self)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 437, in handle_one_request
self.wsgi_execute()
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 287, in wsgi_execute
self.wsgi_start_response)
File "/Library/Python/2.6/site-packages/wphp-0.1dev_r0-py2.6.egg/wphp/__init__.py", line 101, in __call__
self.create_child()
File "/Library/Python/2.6/site-packages/wphp-0.1dev_r0-py2.6.egg/wphp/__init__.py", line 184, in create_child
self.spawn_php(self.fcgi_port)
File "/Library/Python/2.6/site-packages/wphp-0.1dev_r0-py2.6.egg/wphp/__init__.py", line 207, in spawn_php
proc = subprocess.Popen(cmd, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
How should I use WPHP?