How to run perl in MAMP?

If everything is configured properly, put a perl file in your cgi-bin folder, set permissions so that apache can execute it, and you are all set ready to go.

Basically, Perl suffers in this aspect just because it was first and that is the way CGIs were done. PHP came along and the default setting allowed PHP scripts to run from any directory. So this is a little trouble for php programmers.

It took one hour for me to figure out how to run perl in MAMP.

Well here are some easy steps for you.

The permissions for all of those files needs to be 755.


Go to a  Application >> Utility >> and open Terminal.

    cd /Applications/MAMP
    chmod 755 cgi-bin
    cd cgi-bin
    find . -type f -exec chmod 755 \{\} \;

   Put all perl files in cgi-bin folder. 

  /Applications/MAMP/cgi-bin

Run your script 

http://localhost/cgi-bin/test.pl

You are done!

Share

5 thoughts on “How to run perl in MAMP?

  1. May

    Hello, it doesnt’ work for me.
    After typing this command,
    find . -type f -exec chmod 755 \{\} \;
    I’ve got this error
    find: -exec: no terminating “;” or “+”

    I look forward to hearing from you.
    Thanks in advance,
    May

Leave a Reply

Your email address will not be published. Required fields are marked *