What is a CGI script?
A CGI script is a small program that runs on your server when a visitor opens a page. Many old contact forms and counters use them. They are often written in Perl or Python and live in a folder named cgi-bin.
When they fail, you usually see "500 Internal Server Error" or the plain code is shown on the page. A 500 error means the server tried and failed.
Step 1: Turn on CGI support
- Log in to Plesk.
- Go to Websites & Domains.
- Click Hosting Settings for your domain.
- Under Services or Dynamic website settings, tick CGI support. Tick Perl support too if your script uses Perl.
- Click OK.
If the box is missing, your plan may not allow CGI. Ask Hostvento support.
Step 2: Put the script in the right folder
- Open File Manager in Plesk.
- Go to your domain folder and find
cgi-bin. It sits next tohttpdocs. - Upload your script there.
Scripts outside cgi-bin usually do not run as CGI.
Step 3: Set the right permissions
Permissions say who may read or run a file. A script must be allowed to run.
- In File Manager, click the permissions link next to the script.
- Tick Execute for the owner. A normal safe value is
755. - Click OK.
Warning: Do not use 777. It lets anyone change the file. The server may block it too.
Step 4: Check the first line
The first line of the script tells the server which program runs it. For Perl, it often looks like this.
#!/usr/bin/perl
This line points to Perl. The path must match the server. Ask Hostvento support for the right path.
Step 5: Check line endings and logs
- A script saved on Windows may have the wrong line endings. Save it with Unix line endings in your editor, and upload it as text.
- Open Logs for your domain in Plesk. Look at the error log. It names the problem.
Still stuck? Open a support ticket and send the log lines.
Quick recap
- Turn on CGI support in Hosting Settings.
- Keep scripts in
cgi-bin. - Set permissions to
755. - Check the first line and the error log.