Apache can't execute Python scripts -
I have a dragon script that I try to execute from an html page. I setup Apache CGI I like to execute the dragon simple article like hello world and can work fine but does not work with cx_orracle module but i need to update and retrieve data from the oracle database. Script (test.py) When I try to execute from the browser, I see error 500 in the Apache server log shown in this: I run Python script in the command line and works fine, but when I execute from Does not try a web browser any advice ??
import json import cx_Oracle import cgi import cgitb lst_proveedores = [{}] conn_str = 'user / pass @ databse' con = cx_Oracle.connect (conn_str) c = Conn.cursor () c.execute ('select id, mon_proveedores to nombre') For line c: record1 = {"id": line [0], "nombre": line [1]} lst_proveedores.append (record1) json_string = json.dumps (lst_proveedores) print conn.close json_string ()
traceback (most Recent call last): In the file "/var/www/cgi-bin/test.py", line 2,? Import cx_Oracle ImportError: No module script header header cx_Oracle designated end time: test.py
Comments
Post a Comment