を「OSErrorの拒否[ERRNO 13]許可」:PythonのCGIHTTPServerはでクラッシュ:私は私のホームディレクトリから次のコマンドを実行しています
python -m CGIHTTPServer
これは、サーバーが実行されますが、私は、スクリプトにアクセスしようとすると、 cgi-binディレクトリ私は得る:
Traceback (most recent call last):
File "/usr/lib/python2.7/CGIHTTPServer.py", line 251, in run_cgi
os.execve(scriptfile, args, env)
OSError: [Errno 13] Permission denied
ルートとして実行しても違いはありません。
[email protected]:~$ ls -lhR
.:
total 12K
drwxr-xr-x 2 student student 4.0K Jun 13 18:38 cgi-bin
drwxr--r-- 2 student student 4.0K Jun 10 2004 kalpy
-rwxrwxrwx 1 student student 2.0K Jun 13 12:37 test.html
./cgi-bin:
total 8.0K
-rwxr-xr-x 1 student student 31 Jun 13 18:38 test.py
編集:test.pyの内容は次のとおりです。
#!/usr/bin/python
print "test"
シェバングが有効である:個人的に
~$ which python
/usr/bin/python
_shebang_行が 'test.py'から見えると便利です。定義されたインタプリタが有効な実行可能ファイルでない場合、このエラーが発生する可能性があります。 – rodrigo
ありがとう@rodrigo、私はこの情報を含めるために私の質問を編集しました。 – qwertyboy