WebARENA VPSクラウドでpythonのプログラムを動かしたいと思っています。
自分のPCでのxampp環境等ではpythonで作成したプログラムは動作します。
しかしWebARENA VPSにpythonのインストール自体はうまくされている様子は伺えますが、
実行するとエラーで動かないのでなんとか解決したいと思っています。
まずインストールされている状態等です。
CentOS release 6.10 (Final) which python /usr/bin/python which python3 /usr/bin/python3 python --version Python 2.6.6 python3 --version Python 3.6.7
まずは http://~~~~~~/ごにょごにょ.py パイソンファイルを実行した時に出るエラーメッセージです。
.pyファイルをブラウザで実行した時のエラー Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost 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.
エラーログファイルに出力されるエラーを調べる流れで
/var/log/httpd/error_log
を調べました。
(2)No such file or directory: exec of ~~exec of '/var/www/html/ごにょごにょ.py'
これらをネットで調べて以下2つほどをしてみました。
httpd.confの編集で、
AddHandler cgi-script .cgi .py
Options Includes ExecCGI FollowSymLinks
しかしエラーは修正されませんでした。
.pyファイルの冒頭を
#!/usr/bin/python #!/usr/bin/python3
2つほど書き換えてみたり
ファイルの保存形式をCR+LFでなく
LFで保存、などしてみましたが、
色々このあたりを変えて実行を挑んでも
Premature end of script headers: (8)Exec format error: exec of (2)No such file or directory: exec of
主にこれらのエラーが交互に交互に表示されるのみです。
コマンドラインではpythonでprint等できましたので、
.pyファイルを実行できる状態を自分で作成できていないのだと思うのですが、
宜しくお願いします…。
あなたの回答
tips
プレビュー