Use CGI Scripts

Last change on 2026-05-18 • Created on 2026-05-18 • ID: MA-5CDD3

You can place CGI scripts in your public_html directory and execute them there. Make sure that the file and the parent directories have the correct permissions.

Place the CGI script

Place your CGI script at the desired location inside public_html.

Example:

public_html/cgi-bin/script.cgi

Depending on the script, another file extension may also be used, for example .pl for Perl scripts.

Check permissions

For the script to be executed, the permissions must be set correctly. CGI scripts often require execute permissions.

Also check whether the first line of the script points to the correct interpreter.

Example for Perl:

#!/usr/bin/perl

Use paths in Perl scripts

If your Perl script needs to access other files, use the full server path.

The format is:

/usr/www/users/FTP_LOGINNAME/PATH_TO_FILE

Replace the placeholders with your own values:

Placeholder Meaning
FTP_LOGINNAME Your FTP login name
PATH_TO_FILE The path to the file inside your account

Example:

/usr/www/users/example/public_html/data/config.txt

Do not use relative paths if your script needs to find files reliably from different working directories.

Table of Contents