投稿

ラベル(CGI)が付いた投稿を表示しています

UniServer(Uniform Server) Zero で Python を動かす

簡単に Apache + PHP + MySQL の環境が作れる UniServer Zero で Python を動かしたメモ Pythonを ダウンロード + インストール 必要によって python.exe ディレクトリへパスを通す(cgiとしては通す必要ないです) インストールディレクトリ\PythonXX\ やら \PythonXX\Scripts に通しておくと便利です UniServerZ\core\apache2\conf\httpd.conf を開く py拡張子でスクリプト動作させる場合 httpd.conf の AddHandler cgi-script .cgi ↓ AddHandler cgi-script .cgi .py wwwフォルダでも cgi を動作させる場合 httpd.conf の <Directory "{$US_ROOTF_WWW}"> を探して Options Indexes Includes の下に Options +ExecCGI を書き加える test.py なんかを作って置いてみる※pythonのパスはそれぞれで #!C:\Python27\python.exe print("Content-type: text/plain") print("") print("Hello Python World!")