How to Enable CGI/Perl Support on Bluehost
Bluehost hosting is compatible with CGI and Perl scripts; however, it's important to note that we do not directly provide development support for these scripting languages. Our primary focus is ensuring that your hosting environment can support the execution of such scripts when configured correctly.
We’ll do our best to help you troubleshoot related issues. Still, there may be cases where the problem is related to custom coding or script configuration that falls outside our support scope.
- Enable CGI/Perl Support
- Troubleshooting CGI/Perl Script Issues
- Compatibility Notes
- Helpful CGI/Perl Resources
- Summary
Enable CGI/Perl Support
- Use a Linux Hosting Plan – CGI/Perl is supported on Linux shared, VPS, and Dedicated hosting plans.
- Upload Perl Scripts to the
cgi-bin
Directory:- Navigate to your
public_html
folder via FTP or File Manager. - Create a folder named
cgi-bin
if one does not already exist. - Upload your
.pl
or.cgi
files into this folder.
- Navigate to your
- Set Correct Permissions:
- Files should be set to
644
permissions to be executable.
- Files should be set to
- Ensure Correct Shebang Line:
- The first line of your Perl script should be:
#!/usr/bin/perl
- You can confirm the correct path to Perl via SSH by running:
which perl
- The first line of your Perl script should be:
- Test the Script in Your Browser:
- Visit https://yourdomain.com/cgi-bin/your-script.pl to check if it executes.
Troubleshooting CGI/Perl Script Issues
- 500 Internal Server Error: Usually caused by incorrect file permissions or syntax errors in the script.
- Script not executing: Make sure the script has the correct shebang path and file extension (
.pl
or.cgi
). - Script outputs code instead of running: Check that the file is in the
cgi-bin
directory and has executable permissions.
Compatibility Notes
- CGI/Perl is still functional on Bluehost, but it’s considered a legacy scripting method.
- If your application depends on CGI/Perl, ensure your codebase is maintained for security and compatibility with modern server environments.
- Bluehost’s servers prioritize modern PHP support, so using PHP may offer better performance and support.
Helpful CGI/Perl Resources
Here are external resources for learning more about CGI and Perl scripting:
Related Bluehost Articles
- How to Change File Permissions in cPanel
- How to Navigate cPanel File Manager
- What is SSH Access and How to Enable It in Your Hosting Account
Summary
While Bluehost supports CGI and Perl scripts through its hosting environment, we do not directly support the active development or debugging of custom CGI code. If you need to enable CGI Perl on Bluehost, follow the setup steps above and refer to the recommended resources for additional help. Consider using PHP whenever possible for a more modern and widely supported scripting environment.
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.