How do I install and run a CGI or Perl script?

CGI / Perl scripting support is not included with our Budget hosting plan, however it is included with all our other hosting plans.

To install a CGI / Perl script within Plesk, simply upload the script to your cgi-bin folder, ensure that he script permissions are set to 755 and execute the script in your browser. If your script is valid and the file permissions are correct then your script will run.

CGI / Perl commonly asked questions:

1. What is my path to perl?

#!/usr/bin/perl

2. What is my path to sendmail?

/usr/sbin/sendmail

3. May I run custom CGI scripts?

Yes, you may.

4. Can I use perl to talk to my MySQL database?

Yes, as long as you have a hosting package that includes CGI / Perl support.

5. Can I use PHP to connect to my MySQL database?

Yes, you may.

6. What directory must my Perl files reside in?

CGI or Perl scripts must reside in your cgi-bin directory.

7. What is the absolute path to my cgi-bin?

/var/www/vhosts/yourdomain.com/cgi-bin

8. How do I reach them from a browser?

http://www.yourdomain.com/cgi-bin/filename

9. What directory must my PHP files reside in?

PHP files must reside in your html directory

10. What is the absolute path to my html directory?

/var/www/vhosts/yourdomain.com/httpdocs

11. How do I reach them from a browser?

http://www.yourdomain.com/filename

12. I keep getting internal server error from my Perl script. What does this mean?

Make sure your script was uploaded in ASCII
Make sure the permissions on the files are 755
Make sure the top line of your scripts reads #!/usr/bin/perl

For tutorials and help guides on all aspects related to your hosting account please follow the link below:

Web Hosting Help Centre

Was this helpful?