Antworten auf Ihre häufigsten Fragen

Wie lauten die Pfade zu den Skriptinterpretern?

English Version below

Sie können CGI-Skripte von anderen Servern nicht immer einfach übernehmen, sondern müssen sie ggf. an einigen Stellen anpassen. In vielen Fällen ist es der Interpreter, welcher einer Anpassung bedarf. Bei CGI-Skripten sollte sich dieser immer in der ersten Zeile befinden, z.B.: #!/usr/bin/perl

Eine Ausnahme bilden hier Bash-Skripte und PHP.

Bash Skripte werden in der Regel auf WebServer oder WebServer Dedicated Produkten direkt von der Kommandozeile aus gestartet, wobei hier nicht zwingend ein Interpreter im Skript angegeben werden muss. Dieser ist lediglich erforderlich, wenn das Skript durch seinen Namen direkt, aus anderen Skripten heraus oder als Cronjob aufgerufen werden soll.

PHP wird auf unseren Servern nicht als CGI-Skript ausgeführt, wodurch die Angabe des Interpreters entfallen kann. Nur, wenn Sie beispielsweise auf einem WebServer ein PHP-Skript als Cronjob ausführen möchten, ist die Angabe des Interpreters zwingend erforderlich.

Im folgenden eine kleine Übersicht der Interpreter der bei uns verfügbaren Skriptsprachen.

Skriptsprache Interpreter
Bash #!/bin/sh oder #!/bin/bash
Perl 5.20.2 #!/usr/bin/perl
PHP (Standardversion, aktuell 8.1) #!/usr/bin/php bzw. #!/usr/local/bin/php
PHP 8.1

#!/usr/bin/php8.1

   
PHP 8.2 #!/usr/bin/php8.2
Python (Standardversion, aktuell 2.7.9)

#!/usr/bin/python

Python 3.4.2 #!/usr/bin/python3
Ruby 2.1.5 #!/usr/bin/ruby
TCL 8.6.2 #!/usr/bin/tclsh

Ein anderer wichtiger Pfad ist der zu sendmail. Mit sendmail können Sie aus Skripten heraus E-Mails versenden. Aus Skripten heraus können Sie sendmail über den Pfad /usr/sbin/sendmail ansprechen.

 

 

English Version:

You cannot always simply adopt CGI scripts from other servers, but may have to adapt them in some places. In many cases, it is the interpreter that requires adaptation. For CGI scripts, this should always be in the first line, e.g: #!/usr/bin/perl

Bash scripts and PHP are an exception.

Bash scripts are usually started on WebServer or WebServer Dedicated products directly from the command line, whereby an interpreter does not necessarily have to be specified in the script. This is only required if the script is to be called directly by its name, from other scripts or as a cronjob.

PHP is not executed as a CGI script on our servers, which means that the interpreter does not need to be specified. Only if you want to run a PHP script as a cronjob on a web server, for example, is it mandatory to specify the interpreter.

The following is a small overview of the interpreters of the scripting languages available from us.

Skriptlanguage Interpreter
Bash #!/bin/sh oder #!/bin/bash
Perl 5.20.2 #!/usr/bin/perl
PHP (standard version, currently 8.1) #!/usr/bin/php bzw. #!/usr/local/bin/php
PHP 8.1

#!/usr/bin/php8.1

   
PHP 8.2 #!/usr/bin/php8.2
Python (standad version, currently 2.7.9)

#!/usr/bin/python

Python 3.4.2 #!/usr/bin/python3
Ruby 2.1.5 #!/usr/bin/ruby
TCL 8.6.2 #!/usr/bin/tclsh

Another important path is the one to sendmail. You can use sendmail to send emails from scripts. You can address sendmail from scripts via the path /usr/sbin/sendmail.


otto.friedrich@hosteurope.de xanthippe.ypsilante@hosteurope.de hercules.ikarus@hosteurope.de