Perl and Python scripts Kenya Print
- 0
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:
Was this answer helpful?
Related Articles
The Best Web Hosting Company in Nairobi, Kenya.
Kenya Website Experts Ltd is the Largest Web Hosting Company in Kenya, our core focus is helping and empowering businesses & organizations online. Thousands of customers rely on our domains and web hosting to get their ideas online. We offer everything you need to create an effective & successful online presence backed by expert, personalized customer support. We offer ultra fast, reliable, affordable and secure website hosting services, email hosting, cloud hosting and SSL certificates. We make registration of Kenyan domain names (.co.ke, .or.ke .ac.ke) and international domains (.com, .org, .net) fast, simple, and secure. Our expert team is always on hand to help answer your questions, get you started, and grow your presence online. We deliver on performance, security, reliability and customer service day in, day out, and we’re a trusted partner.