Perl and Python scripts Tanzania

These scripts must have 755 permissions.

Perl = .pl
Python = .py

Example perl script:

#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print "<html><head>";
print "<title>CGI Test</title>";
print "</head><body>";
print "<p>Test page using Perl</p>";
print "</body></html>";

Example python script:

#!/usr/bin/python
print "Content-type: text/html\n\n";
print "<html><head>";
print "<title>CGI Test</title>";
print "</head><body>";
print "<p>Test page using Python</p>";
print "</body></html>";

Activate Python:

Please note that you have to add a line in the .htaccess file to use Python.

The recommended directive is:

Addhandler cgi-script .py .pl .cgi

(This directive covers Perl, Python and CGI files.)

Getting a 500 Internal Server Error?

If you are getting a 500 Internal Server Error, it is most likely caused by the lack of execute permissions. Check to make sure the your Perl or Python script file has permissions of 755.

Disclaimer:

Please note that these scripts are only examples, and we cannot guarantee that these scripts will work, nor can we assist with custom configurations of such scripts.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Create Custom Error Pages Tanzania

This tutorial will teach how to create custom Error Pages. Create error pages for 404 Not Found...

How To Install and Uninstall FrontPage Extensions Tanzania

This tutorial will show you how to install and uninstall FrontPage extensions. Please note that...

How To Set Up A Cron Job Tanzania

This tutorial is going to show you how to setup a cron job in cPanel the easy way. You can set a...

Using Index Manager Tanzania

This tutorial will teach about using the Index Manager. The Index Manager allows you to customize...

Limiting Simultaneous Connections in FileZilla Tanzania

Open FileZilla. Access the Site Manager.   Click your site, then select the Transfer...

Powered by WHMCompleteSolution