MIDAS Knowledge Base MIDAS Knowledge Base

How to install & configure Strawberry Perl on Windows

This guide outlines how to install Strawberry Perl on Windows. Strawberry Perl is a free, open-source distribution of Perl for Windows that bundles everything needed to run and build Perl scripts, including a C compiler and the cpan module tool. Other Windows distributions of Perl (such as ActivePerl) are also available.

The steps below apply to current 64-bit editions of Windows, including Windows 10, Windows 11, and Windows Server (2016 onwards). Older 32-bit versions of Windows are also catered for in Step 1.

This article forms part of our multipart series "How to install prerequisites needed for running a self-hosted edition of MIDAS from a Windows server", and applies to self-hosted installations of MIDAS booking software on Windows-based servers. It assumes that you've already successfully completed our previous "How to install & configure Apache on a Windows server" guide.

Please note that this article is provided "as is" and is correct at time of writing. For further assistance installing/configuring Perl, please refer to the vendor's own documentation/support.

Contents:


Step 1 - Download Strawberry Perl for Windows

Strawberry Perl may be freely downloaded from strawberryperl.com. It's distributed both as an MSI installer (recommended for a server install, as it sets everything up and adds Perl to your PATH automatically) and as a portable ZIP edition (which can be run without installing). This guide uses the MSI installer.

If you're running a 64-bit Windows operating system, download the MSI edition listed in the "Latest Release" box on the Strawberry Perl site:

Download Strawberry Perl for Windows

If you're running on an older 32-bit Windows OS, you'll need to instead download an older version of Strawberry Perl by selecting the "Zip, Portable, special editions" link in the "More Downloads" box. On the following screen, select the latest 32-bit MSI edition in the "Recommended Downloads" section.


Step 2 - Install Strawberry Perl

Run the Strawberry Perl Installer and read & accept the License Agreement. You'll then be prompted for a location to install Strawberry Perl to (the default is C:\Strawberry):

Choose where to install Strawberry Perl to

Click "Next", and the installer will inform you that it's ready to install. Click "Install":

Ready to install Strawberry Perl

The installer will then install Strawberry Perl...

Installing Strawberry Perl

...and will inform you once installation is complete:

Strawberry Perl Installed


Step 3 - Test

Once the Strawberry Perl installer has completed, let's test Perl to ensure that it's working correctly.

First, confirm that Strawberry Perl itself is installed. Open a new Command Prompt or PowerShell window and enter:

perl -v
You should see the installed version of Perl reported back. (If instead you see "'perl' is not recognized as an internal or external command", see Troubleshooting below.)

Next, let's confirm that Apache can correctly execute Perl scripts.
Open a standard text editor and add the following two lines:

#!C:\Strawberry\perl\bin\perl.exe
print "content-type:text/html\n\nHello World!";

Save this file as "test.pl" to C:\Apache24\htdocs (or D:\Apache\htdocs, etc depending upon where you installed Apache)

Next, in your web browser, navigate to http://127.0.0.1/test.pl, and you should then see the words "Hello World!" in your browser:

Perl Hello World Test Script

...which indicates that Perl has been correctly installed!

If however, you see the entire contents of your test.pl file, then Apache didn't know how to handle your .pl file, and so instead of "executing" it, displayed its contents as plain text instead. In which case, please check Step 3 of our "How to install & configure Apache on a Windows server" guide.

If all you see is a server error when accessing test.pl in your browser, it's likely that you've not correctly configured Apache to handle .pl files or to execute cgi scripts (please refer back to our "How to install & configure Apache on a Windows server" guide), or there's a typo in your test.pl file. See Troubleshooting below for more.


Step 4 - Install Additional Modules

Note: Steps 1 to 3 above complete a standard Strawberry Perl installation. This final step is specific to preparing a server to run MIDAS. If you've installed Perl for another purpose, you can stop here.

Once you have your test.pl script displaying "Hello World!" in your browser, it's now time to download and run our MIDAS "Server Readiness" tool.

This utility will analyze your current server setup and ensure that you have all the necessary Perl modules required for running a self-hosted edition of MIDAS. Our Server Readiness Tool may be freely obtained via the MIDAS Server Requirements page.

Save/upload the utility to the same server location as your previous "test.pl" script, and then access it via your browser in the same way.

Let the Server Readiness tool run, and make note of any missing required Perl modules:

MIDAS Server Readiness Tool

To install any additional modules with Strawberry Perl, please refer to our "How to install Perl modules via Strawberry Perl" KB article.

Re-run the MIDAS Server Readiness tool again in your browser to check that the previously missing modules have now been installed.


Troubleshooting

If Perl doesn't behave as expected after installation, the cause is usually one of the following:

"'perl' is not recognized as an internal or external command, operable program or batch file"

Windows can't find Perl on its PATH. The Strawberry Perl MSI installer normally adds Perl to your PATH automatically, but any Command Prompt or PowerShell windows that were already open before you installed won't pick up the change. Close and reopen your command prompt (or sign out and back in) and try again. If the problem persists, confirm that "C:\Strawberry\perl\bin" and "C:\Strawberry\c\bin" are present in your system PATH environment variable.

Your test.pl script displays as plain text in the browser

If the browser shows the contents of test.pl rather than the words "Hello World!", Apache served the file as text instead of executing it, which means Apache hasn't been told how to handle .pl files. Refer back to Step 3 of our Apache on Windows guide to add the ".pl" handler and the "ExecCGI" option.

You see a "500 Internal Server Error"

A 500 error usually means Apache tried to run the script but Perl couldn't execute it. Check that the first line of test.pl points to the correct location of perl.exe (e.g. #!C:\Strawberry\perl\bin\perl.exe), that "ScriptInterpreterSource Registry" is present in your Apache configuration, and that there are no typos in the script. Apache's "logs\error.log" file will usually identify the exact cause.

The installer won't run or is blocked

On locked-down servers, antivirus or endpoint security software can occasionally block the installer. Make sure you're running it with administrative privileges, and if necessary temporarily allow it through your security software.


Strawberry Perl FAQs

Is Strawberry Perl free?

Yes. Strawberry Perl is a free, open-source distribution of Perl for Windows.

Which versions of Windows does Strawberry Perl support?

Current 64-bit releases run on Windows 10, Windows 11, and Windows Server (2016 onwards). For older 32-bit versions of Windows, download an older 32-bit release as described in Step 1.

What's the difference between Strawberry Perl and ActivePerl?

Both are Perl distributions for Windows. Strawberry Perl is free and open source, and bundles a C compiler and the tools needed to build modules from CPAN. ActivePerl is an alternative distribution from ActiveState. Whilst we recommend Strawberry Perl, either can be used to run a self-hosted edition of MIDAS; see our ActivePerl guide if you'd prefer to use ActivePerl.

Where is perl.exe installed?

By default, Strawberry Perl installs to "C:\Strawberry", and perl.exe is located in "C:\Strawberry\perl\bin". You can confirm the installed version at any time by running perl -v from a command prompt.

What's the difference between the MSI and portable editions?

The MSI edition installs Strawberry Perl and adds it to your PATH automatically, and is recommended for a server install. The portable (ZIP) edition can be extracted and run without installing, which is useful for USB drives or for running more than one version of Perl side by side.

How do I install additional Perl modules?

See our How to install Perl modules via Strawberry Perl guide. For MIDAS specifically, the Server Readiness tool in Step 4 tells you exactly which modules you need.


Also In This Series...



Further Reading


← Return to the Knowledge Base