What do I need to change the types to in order to get Perl to run on my local machine? Is it possible to run Perl through Internet Explorer or Netscape?
Hope it helps.
-Andy
When I installed both of these, some time ago, I am sure IE version 5 would run Perl scripts. I have since upgraded to version 6 of IE and this will not run the scripts.
This [localhost...] some of you have mentioned: what is this and how can it be set up? Can I get software to emulate a webserver on my local machine?
And yes, currently I am using file:... to access the files, but [localhost...] does not work. I would expect a directory listing of some sort if it were set up on my machine, but I get page not found.
P.S. Have you all been sat waiting for my post today, because these responses have been a bit quick :)
The ultimate goal, is to perfectly emulate your online/offline stuff. Once you get there, you cut out the "upload and test" step that you have to go through when developing pages. There is little that will boost your productivity than running a local copy of your sites.
Like in April, when I had to completely rewrite a shopping basket that collapsed and no-one could order; I could not figure out what was wrong so I started it again, working 20 hour days for around a week.
It also helps you see what other people have to 'put up with' if you use your own site to find products when people phone, however, I don't want to be online all the time or have to wait for a dial in to find my own products!
I have written a Perl search engine (in the smallest sense of the phrase!) to allow users to search for products quickly, rather than the current JavaScript version that works, but is stupidly slow when searching over 1000 products and the user has to download all the description BEFORE the searching even starts!
I now have it partially working, [localhost...] shows my site, accessing subdirectories now working fine.
The cgi-bin is still the problem. Running a script shows Internal Server Error. Now, I assume the error is because the Perl scripts begin with '#!/usr/bin/perl' and it doesn't know where to look. Can anyone help with this problem?
My local version of Perl is at 'C:\Perl\bin\Perl.exe'.
I obviously do not want to change the first line of code in the .cgi file because it will not work when uploaded to my host. So is there any way around this to force the local variety to a different location than specified in the script?
If not, I would highly suggest reinstalling perl into /usr on your windows box (that's where mine is). It will prevent long term headaches and make off-the-shelf scripts run out of the box.
You might try (I'm not sure about this) just renaming/moving your current install (maybe copy?) to /usr so that the perl.exe ends up as /usr/bin/perl.exe. I don't think there is anything touchy about the perl install in the registery. You probably will also want to put /usr/bin on your path in your autoexec.bat file. example:
path=C:\WINDOWS;C:\WINDOWS\COMMAND;c:\windows\system;c:\usr\bin;
'...[error] [client 127.0.0.1] malformed header from script. Bad header=<html><head><title>...'
I assume it is trying to run the script and getting a response it isn't expeting? Have you seen this before? How do I get Apache to send a header? I have already got in the CGI script to send the content-type and a DOCTYPE information, but it must want something else?
Options All Indexes FollowSymLinks MultiViews
Then you might want to try a script alias line:
ScriptAlias /cgi-bin /www/foo/cgi-bin
(point the second path to where ever you have cgi's installed)
ScriptAlias /cgi-bin/ <local-cgi-bin>
<Directory <local-cgi-bin>>
AllowOverride None
Options Indexes FollowSymlinks MultiViews
Order allow,deny
Allow from all
</Directory>
Where <local-cgi-bin> was too long to put in!
In theory, shouldn't this work? It is in a block which starts with "<IfModule mod_alias.c>". Would this make a difference? Although it was there originally, so I assume it should be in that block.
I've tried the options with the All parameter in and without (as default) and still get server error.
I don't know why it works on my webhost but locally but to sum the problem up, all I needed to do was put linebreaks in the output from the CGI Perl files!
My Content-type:... and <!DOCTYPE... outputs were all on the same line when output (but different lines in the program!)