Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

strawberry perl on localhost windows

by traincity (Sexton)
on Jun 17, 2019 at 22:17 UTC ( [id://11101496]=perlquestion: print w/replies, xml ) Need Help??

traincity has asked for the wisdom of the Perl Monks concerning the following question:

Hi.. Using windows 10, Latest strawberry download, apache 24.

I need help in associating .pl with strawberry. When I try putting localhost/cgi-bin/test.pl in browser I get this error:

Internal Server Error The server encountered an internal error or misconfiguration and was u +nable to complete your request. Please contact the server administrator at trainman@traincity.com to i +nform them of the time this error occurred, and the actions you perfo +rmed just before this error. More information about this error may be available in the server error + log.

So I go to the error log and this is what is showing:

[Mon Jun 17 18:04:55.584500 2019] [cgi:error] [pid 12736:tid 1148] (OS + 2)The system cannot find the file specified. : [client ::1:49450] c +ouldn't create child process: 720002: test.pl [Mon Jun 17 18:04:55.584500 2019] [cgi:error] [pid 12736:tid 1148] (OS + 2)The system cannot find the file specified. : [client ::1:49450] A +H01223: couldn't spawn child process: C:/mychoo/cgi-bin/test.pl

So I believe I have configured apache correctly as the correct path is C:/mychoo/cgi-bin/test.pl

I think the problem is that .pl is not associated with strawberry.

This is the test file code:

#!/usr/bin/perl use strict; use warnings; print "hi NAME\n";

I believe the path line on top should be ignored in windows, but I could be wrong.

Can anyone see what is happening and a resolution to this problem? I really need to get this going before I can continue with perl. One note in the httpd.conf file for php I have this code:

AddHandler application/x-httpd-php .php AddType application/x-httpd-php .php .html LoadModule php7_module "C:/php7/php7apache2_4.dll" PHPiniDir "c:/php7"

I think I needed that to associate .php files with php7. Is there some sort of a fix like that??

I tried changing the registry to associate .pl with strawberry but that did not work.

Thanks for any help!

One other thing, there used to be a message board perl guru or something like that. I get an error when I try to open that up now. Has that been disabled?

I'd really appreciate any help. Thanks much!!

Replies are listed 'Best First'.
Re: strawberry perl on localhost windows
by NetWallah (Canon) on Jun 18, 2019 at 03:47 UTC
    Decoding the HTML mashup in your message, I see the error message is:
    Mon Jun 17 18:04:55.584500 2019 cgi:error pid 12736:tid 1148 (OS 2)Th +e system cannot find the file specified. :client ::1:49450 couldn't + create child process: 720002: test.pl Mon Jun 17 18:04:55.584500 2019 cgi:error pid 12736:tid 1148 (OS 2)Th +e system cannot find the file specified. : client ::1:49450 AH01223: + couldn't spawn child process: C:/mychoo/cgi-bin/test.pl
    It is likely that mod-perl is incorrect, or not installed at all , on your Windows Apache.

    Please follow these links (second one is easier on the eyes):
    mod_perl 2.0 Win32 Installation Instructions
    Configuring the Apache Web Server to Run Perl Programs on Windows

                    Time is an illusion perpetrated by the manufacturers of space.

      Thanks for the comments. I am back to square one but I think the answer is that mod_perl is not actually installed. (Thanks for the suggestion.) I have heard you don't need it with strawberry, but if that is true I don't know how to set up strawberry to do this so I continued trying to set up mod_perl.

      Everything was going OK as I ran makefile.pl and I got a message that the apxs utility was not found. I have no idea what that is. It asked me if I wanted to find them, and I said no but continue. Next I tried to run nmake. nmake is in the directory but it is an empty file (0KB) and of course I got an error. So I'm stuck here. Not able to run nmake test or nmake install. So I'm trying, but this doesn't seem to be working out too well. This is the most temperamental and difficult install I've ever had the pleasure of not figuring out! May have something to do with my stupidity, I don't know! Any suggestions? Thanks again!!!

        Strawberry Perl does not come with mod_perl, so if you want to use it you have to build and configure it. Here is an older guide for perl 5.12 which should give you a starting point.

        perhaps this can help re:nmake:

        NMAKE Reference The Microsoft Program Maintenance Utility (NMAKE.EXE) is a command-line tool included with Visual Studio that builds projects based on commands that are contained in a description file. To use NMAKE, you must run it in a Developer Command Prompt window. A Developer Command Prompt window has the environment variables set for the tools, libraries, and include file paths required to build at the command line. For details on how to open a Developer Command Prompt window, see Use the MSVC toolset from the command line.

        also read: https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019

        Strawberry Perl does not come with mod_perl, so if you want to use it you have to build and configure it. Here is an older guide for perl 5.12 which should give you a starting point.

Re: strawberry perl on localhost windows
by poj (Abbot) on Jun 18, 2019 at 15:15 UTC

    I agree with soonix, on windows 10 (I have Apache 2.2) the shebang line #!/usr/bin/perl gives the error you showed. Use either the full path (for example) #!C:/Perl64/bin/perl.exe or just #!perl. Also you need to print a http header in your test script.

    #!perl use strict; use warnings; print "Content-type: text/plain\n\n"; print "Perl Version $^V $^X\n";
    poj
Re: strawberry perl on localhost windows
by footpad (Abbot) on Jun 18, 2019 at 11:57 UTC

    Regarding the PerlGuru site that you mentioned (http://perlguru.com), it looks as if the site is currently misconfigured. According to the Wayback machine, it was live (and active) as recently as September 2018.

    Unfortunately, the main page does not contain a direct contact link. There are references to the the hosting company.

    In poking at the available links, it appears that the entire site was implemented as CGI calls. Because the site is misconfigured, none of the targets currently work. Other than the site's main page, archive.org doesn't seem to have captured much of the site's content (which is too bad as the site once had enough of a reputation to be included in some of the same lists as the Monastery, not to mention serving as another home for our very own japhy (according to rumor)).

    Additional investigation turned up a contact name and an email address, but the underlying domain appears to have changed hands in 2008 and then allowed to expire. I was unable to find a more recent contact (or web presence) for the original owner or the business.

    At this point, there appears to be little to do, unless someone happens to know the original owner or the webhost is interested in poking about enough to bring things back online.[1]

    --f

    [1] - This might be a bit more work than simply fixing a driver error; the site does not appear to have had a proper SSL certificate when it was last captured.

Re: strawberry perl on localhost windows
by shadowsong (Pilgrim) on Jun 18, 2019 at 13:34 UTC

    Hi traincity

    It looks like NetWallah hit the nail on the head – assuming httpd.exe is in your path, what's the output of the following command:

    httpd -t -D DUMP_MODULES

    Basically, you need to ensure perl_module (or whatever you chose to call it in your apache config/vhost file) is loaded. Moreover, if you don't have mod_perl installed you'll need to take a few steps back...

    Cheers,
    Shadowsong

Re: strawberry perl on localhost windows
by soonix (Canon) on Jun 18, 2019 at 09:18 UTC
    I believe the path line on top should be ignored in windows, but I could be wrong.
    Sometimes, Apache for Windows is configured to obey the shebang line, headword is ScriptInterpreterSource
Re: strawberry perl on localhost windows
by AnomalousMonk (Archbishop) on Jun 18, 2019 at 02:07 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11101496]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found