Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

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

 
discard

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

Browse other questions tagged or ask your own question.