J'essaie d'exécuter un script cgi simple après avoir configuré mon serveur.erreur de serveur interne (500) dans un script cgi simple
Mon script ressemble à ceci:
print "Content-type: text/html"
print
print "<html><head><title>CGI</title></head>"
print "<body>"
print "hello cgi"
print "</body>"
print "</html>"
Quand je vais à mes scripts URL http://127.0.0.1/~flybywire/cgi-bin/main.py
je reçois:
Erreur serveur interne
Le serveur a rencontré une erreur interne ou une mauvaise configuration et n'a pas pu compléter votre demande.
Et error.log
je reçois le texte suivant:
[error] (8)Exec format error: exec of '/home/flybywire/www/cgi-bin/main.py' failed [error] [client 127.0.0.1] Premature end of script headers: main.py
Autres infos:Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 Server at 127.0.0.1 Port 80
merci, cela fonctionne. – flybywire
Je pense qu'ajouter '#!/Usr/bin/python' à tout script cgi est effrayant. Comment le régler par apache SetEnv PYTHONPATH? – gonjay