Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


But no matter what I request in the browser, I get:

Exception happened during processing of request from ('', 49397)
Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/", 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/", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/", line 615, in __init__
  File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/", line 442, in handle
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/", line 329, in handle
  File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/", line 437, in handle_one_request
  File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/", line 287, in wsgi_execute
  File "/Library/Python/2.6/site-packages/wphp-0.1dev_r0-py2.6.egg/wphp/", line 101, in __call__
  File "/Library/Python/2.6/site-packages/wphp-0.1dev_r0-py2.6.egg/wphp/", line 184, in create_child
  File "/Library/Python/2.6/site-packages/wphp-0.1dev_r0-py2.6.egg/wphp/", line 207, in spawn_php
    proc = subprocess.Popen(cmd, env=env)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/", line 595, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/", line 1106, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

How should I use WPHP?

share|improve this question
Is '/path/to/php-files/' what you are really using in your code? Where do your PHP files actually live? – Graham Dumpleton Aug 22 '10 at 23:39
No, I'm using the actual absolute file path to the directory with my PHP files. All my PHP files are readable and executable by everyone. – Nicholas H. Aug 24 '10 at 7:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.