def build_cgi_env(self, scriptname, *args, **kwargs): """ Adds SCRIPT_FILENAME to the env created by CGIHTTPRequestHandler CGIHTTPServer doesn't set the 'SCRIPT_FILENAME' environment variable, which causes php-cgi (on Ubuntu, at least) to fail with "No input file specified." Details: http://community.activestate.com/faq/cgi-debugging-no-input-fi """ env = CGIHTTPRequestHandler.build_cgi_env(self, scriptname, *args, **kwargs) env['SCRIPT_FILENAME'] = self.translate_path(scriptname) return env