Tôi muốn chạy tệp python trong trình duyệt. Tôi đã cài đặt apache. và đã định cấu hình tệp httd.conf
. Tôi đã tạo tệp test.py
. Sau đó, tôi đã thử chạy test.py
bằng trình duyệt của mình bằng cách nhập htt://localhost/test.py
. Khi tôi làm điều này, tôi nhận được lỗi sau:Chạy tệp .py trong trình duyệt
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Trong log lỗi của tôi
[Thu Jul 07 18:39:55 2011] [error] [client 127.0.0.1] (OS 2)The system cannot find the file specified. : couldn't create child process: 720002: test.py
[Thu Jul 07 18:39:55 2011] [error] [client 127.0.0.1] (OS 2)The system cannot find the file specified. : couldn't spawn child process: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/test.py
gì có thể là vấn đề ở đây?
Chạy Python trên trình duyệt nghĩa là bạn phải định cấu hình trình duyệt chứ không phải máy chủ. Khi bạn chạy Python trong trình duyệt, trình duyệt của bạn (FireFox, IE, Opera, Safari, v.v.) đang chạy Python. Điều này không liên quan gì đến Apache. Bạn đang thực sự ** cố gắng làm gì? –
@ S.Lott Và cách cấu hình trình duyệt? –