PDA

View Full Version : Which is the "Perl" of greatest price?


effpeetee
06-24-2007, 08:18 AM
In order to learn Perl, I need a version on my own PC - Windows XP Pro.
I would appreciate some advice as to which is the best route to achieve this;
bearing in mind that I am not all that well versed in installing this kind of software. I believe that I have to have server software also.

Thank you in advance.

Frank - effpeetee

KevinADC
06-24-2007, 08:24 AM
I already suggested you get perl from www.activestate.com in one of your other threads. I think this is the link to download the version you want:

http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.820-MSWin32-x86-274739.msi

KevinADC
06-24-2007, 08:28 AM
You will want an http server so you can run CGI scripts. I suggest apache, it's the same server most webhosts use, it's easy to install but you do need to configure it to run scripts.

www.apache.org

download the http server software. The configuration is not hard but it is a little tricky if you have never done something like that before. See if this link helps you figure it out:

http://www.cgi101.com/book/connect/winxp.html

effpeetee
06-24-2007, 08:34 AM
Thanks KevinADC,

I have already downloaded but have not been successful in the installation.
I'll go to http://www.cgi101.com/book/connect/winxp.html and check it out.

Do I need to download anything else.

Frank

KevinADC
06-24-2007, 08:44 AM
For now, just download perl and apache and try and get them running. There is nothing else to download or install. Later you can install other software if needed, like mysql.

effpeetee
06-24-2007, 09:23 AM
Well, I have installed both Apache and Perl, seemingly successfully, but they do not seem to work.
This is the result that I had before.

I must admit that I don't really know how to check properly, but using a supplied script and trying to call it, was not successful.

I hope that learning Perl is easier.

Back to the drawing-board.

Frank

KevinADC
06-24-2007, 09:42 AM
OK, well, simply saying they do not seem to work is about as useful as saying "I do not seem to feel well" to a doctor. So I am not sure how to help you without getting more information about what you did and what you tried. But right now, I am going to bed (1:30AM my time). Good night.

FishMonger
06-24-2007, 09:48 AM
If you installed Activestate Perl and accepted the defaults during the installation, then the easiest way to tell if Perl is working, you can simply run this command from the command line.

C:\perl -V

or this

C:\perl -e "print 'It Worked!' "

effpeetee
06-24-2007, 10:21 AM
If you installed Activestate Perl and accepted the defaults during the installation, then the easiest way to tell if Perl is working, you can simply run this command from the command line.

C:\perl -V

or this

C:\perl -e "print 'It Worked!' "
'C:\perl is not recognised as an internal or external command, operable program or batch file.'

That's what it says.

Depressing, ain't it?

Frank

FishMonger
06-24-2007, 10:35 AM
It might be that you deselected the option to add Perl to your path environment. CD to Perl's bin directory (unless you specified a different dir, it should be C:\perl\bin) and then try running those commands.

effpeetee
06-24-2007, 11:35 AM
I have re-installed and now get a response - Version etc.

Now I must wait for the book that I have ordered.

I've just tried it again, and now it doesn't work.

I give up.

Thanks for your help.

Frank alias effpeetee

rafiki
06-24-2007, 02:40 PM
I have re-installed and now get a response - Version etc.

Now I must wait for the book that I have ordered.

I've just tried it again, and now it doesn't work.

I give up.

Thanks for your help.

Frank alias effpeetee

what happened to XAMPP?

effpeetee
06-24-2007, 03:17 PM
Well. I have removed the existing programs and re-installed XAMPP. I cannot at present get it to respond. I have put a test.pl file into C:\Mysite/cgi, but I cannot find how to execute it.

I have been on this project for many hours and the initial interest is beginning to wane. I can find plenty of help on the internet for HTML and CSS and Javascript, but I cannot find a similar site for Perl.

Any help as always, gratefully received.

Thank you for your continued help.

Frank

rafiki
06-25-2007, 12:32 AM
Frank, Place your test.pl/cgi in the cgi-bin folder in C:\XAMPP\ if you wish you could install XAMPP into mysite like C:\Mysite\XAMPP\cgi-bin\test.pl and have localhost/test.pl for the URL, remember for server side programming languages you cant just double click on them/open them with your browser they have to have the engine to process what goes on behind the HTML / CSS / Javascript, so always use http://localhost/ to connect to the localpage threw a server

KevinADC
06-25-2007, 06:01 AM
I guess this link didn't help you frank?

http://www.cgi101.com/book/connect/winxp.html

effpeetee
06-25-2007, 08:32 AM
I guess this link didn't help you frank?

http://www.cgi101.com/book/connect/winxp.html
KevinADC,
I must have overlooked it.
I have printed it out and will study it.
Thank you.

rafiki,
I have re-installed Xampp into Mysite,
I'll have another try at using it all and will let you all know what happens.

Regards and thanks.

Frank

XAMPP is now up and running. Thanks to everyone for all the help.

I have now installed Activestate perl 5.8.8

KevinADC
06-25-2007, 05:43 PM
If you use XAMPP you will find it does not work well for perl scripts. Myself and FishMonger have already mentioned this. It is easy to setup but it has many core perl modules missing for some strange reason.

effpeetee
06-25-2007, 05:45 PM
If you use XAMPP you will find it does not work well for perl scripts. Myself and FishMonger have already mentioned this. It is easy to setup but it has many core perl modules missing for some strange reason.
I have installed Activestate perl 5.8.8.

Frank

KevinADC
06-25-2007, 05:51 PM
I know you installed it but you were not able to get your perl scripts running. If XAMPP works then give it a try, but you may find that common perl code such as:

use CGI qw(:standard);
print header();


may not work with XAMPP. If later on you want to revisit getting perl and apache working hopefully someone can help you.

effpeetee
06-25-2007, 08:24 PM
I know you installed it but you were not able to get your perl scripts running. If XAMPP works then give it a try, but you may find that common perl code such as:

use CGI qw(:standard);
print header();


may not work with XAMPP. If later on you want to revisit getting perl and apache working hopefully someone can help you.
Thank you KevinADC,

Perl is working, I get a response from the perltest.
perl -v at the command prompt gives me the perl version OK.
I just cannot get any response from perl scripts downloaded.

I am totally ignorant as to how to start them.

Hence my continued confusion.

Frank

KevinADC
06-26-2007, 01:01 AM
I understand, it's a process, and it can be confusing. But you provide so little feedback its almost impossible to help you get over the hump. I posted a link that has step-by-step instructions for installing and configuring the apache server on windows XP. If you follow those instructions you should be able to get apache running. From there you can run CGI scripts on your local PC just like you do on the internet.

rafiki
06-26-2007, 01:23 AM
I understand, it's a process, and it can be confusing. But you provide so little feedback its almost impossible to help you get over the hump. I posted a link that has step-by-step instructions for installing and configuring the apache server on windows XP. If you follow those instructions you should be able to get apache running. From there you can run CGI scripts on your local PC just like you do on the internet.

im sure XAMPP will be just fine for what Frank has in mind, if he comes across errors on XAMPP not being able to process his scripts properly then he can come back and read up on your tutorials, but if somethings not broke.. why fix it?

FishMonger
06-26-2007, 05:35 AM
im sure XAMPP will be just fine for what Frank has in mind, if he comes across errors on XAMPP not being able to process his scripts properly then he can come back and read up on your tutorials, but if somethings not broke.. why fix it?Well, IMHO XAMPP is broken, so maybe it should be fixed. :) :)

effpeetee
06-26-2007, 09:17 AM
Well, IMHO XAMPP is broken, so maybe it should be fixed. :) :)
I thank all of you for your help. Let me state the position as I may have confused you all.

I installed XAMPP but I have subsequently installed Perl 5,8.8. from ActiveState. According to their test, perl is working; also the version details are downloadable at the command prompt. Apache is also working according to the programs own test.

Since my last post, I have downloaded a clock program, and by copying it into several likely places, I have got it to work.

What I need to do now is to delete the program from one place at a time until I find at which location perl is finding the program. It seems that local host is not where I thought it was.

I may not be very bright, but I am very persistent. It usually pays off, especially with such nice friends to help me.

I have not ignored your advice, I have printed off the document that you recommended but it didn't tell me what I want to know. Which cgi-bin is the real cgi-bin.

Frank

KevinADC
06-26-2007, 10:39 AM
in the apache folder, find the htdocs folder. In the htdocs folder, find the cgi-bin folder. Thats where your cgi scripts should go that you invoke from localhost/cgi-bn/yourscript.pl

effpeetee
06-26-2007, 11:27 AM
in the apache folder, find the htdocs folder. In the htdocs folder, find the cgi-bin folder. Thats where your cgi scripts should go that you invoke from localhost/cgi-bn/yourscript.pl
There is no cgi-bin folder in the htdocs folder.
I tried putting one there and put my scripts into it.

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

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Why is everything so difficult. I followed the instructions to the letter.

Most frustrating. I think I'll put XAMPP back in. DOES SO with Perl 5.8.8

Just added

I have finally found it. C:\xampp\cgi-bin\

Frank

KevinADC
06-26-2007, 04:30 PM
ahh.... I thought you had installed apache as a seperate application. In which case there should be a cgi-bin folder in an htdocs folder. As far as xxamp goes, I have no idea how that is setup but it seems you found it.

If you did install apache, I think the top level folder is called "apache group" on windows. The directory structure is something like:

c:\program files\apache group\apache\htdocs\cgi-bin

of course you actual installation may vary. You can also use the "find Files/Folders" feature of XP to locate a folder named "htdocs" and track down where it is on your hard drive.

effpeetee
06-26-2007, 04:40 PM
ahh.... I thought you had installed apache as a seperate application. In which case there should be a cgi-bin folder in an htdocs folder. As far as xxamp goes, I have no idea how that is setup but it seems you found it.

If you did install apache, I think the top level folder is called "apache group" on windows. The directory structure is something like:

c:\program files\apache group\apache\htdocs\cgi-bin

of course you actual installation may vary. You can also use the "find Files/Folders" feature of XP to locate a folder named "htdocs" and track down where it is on your hard drive.
KevinADC,
I am slowly going mad! I had it all working and went to bed. When I got up and tried again, it didn't find the file. I have removed Xampp and installed Apache, carefully doing all the mods. Installed Perl 5.8.8. and I cannot get it to work.

Why oh WHY did the Apache people, knowing the correct settings for XP, produce a setup sheet without the need to alter it locally? I have gone over the alterations several times and have had a friend check with me, but with no apparent faults, the setup will not work reliably.

Is there somebody who has a working set up document who would email a copy to me? If I don't get a working copy soon. I will have to forget all about Perl and get on with the rest of my life.

Frank

KevinADC
06-26-2007, 05:13 PM
I am slowly going mad! I had it all working and went to bed. When I got up and tried again, it didn't find the file. I have removed Xampp and installed Apache, carefully doing all the mods. Installed Perl 5.8.8. and I cannot get it to work.

I have no idea why that would happen. I installed apache once years ago and it has always worked,

Why oh WHY did the Apache people, knowing the correct settings for XP, produce a setup sheet without the need to alter it locally? I have gone over the alterations several times and have had a friend check with me, but with no apparent faults, the setup will not work reliably.

It's not up to the apache people to decide how your server configuration should be. It is fully customizable and can be setup many different ways. Thats where the step-by-step instructions that people have written and posted to the internet come in handy. You don't need to understand how apache works at all, you just need to know how to use a text editor and follow the instructions for configuring the httpd.conf (or whatever) file.

Is there somebody who has a working set up document who would email a copy to me? If I don't get a working copy soon. I will have to forget all about Perl and get on with the rest of my life.

What version of apache did you install?

KevinADC
06-26-2007, 05:18 PM
You can still always upload your perl scripts to your web server and run/test them that way. The local server is a convenience so you can test scripts without the need to be on the internet. It also gives you a development platform so you don't mess up your production platform by accident if you upload some script that does something "dangerous", like delete all your files.

FishMonger
06-26-2007, 05:20 PM
Apache's cgi-bin directory is NOT a sub directory of htdocs. They are parallel to each other.

Your path will very depending on the version of Apache and how you installed it.
On my home system it's:
C:\Apache2\htdocs
C:\Apache2\cgi-bin

On my work system it's:
C:\Program Files\Apache group\Apache\htdocs
C:\Program Files\Apache group\Apache\cgi-bin

Assuming that XAMPP was completely uninstalled and Perl & Apache were installed correctly, all that's needed is a couple minor adjustments to the httpd.conf file which is in the conf directory which is also parallel to htdocs.

Please provide the following info:
1) The full path to the Apache folder
2) Your IP address and hostname
3) Your httpd.conf file attached as a text file

effpeetee
06-26-2007, 06:14 PM
Please provide the following info:
1) The full path to the Apache folder - see below
2) Your IP address and hostname - localhost
3) Your httpd.conf file attached as a text file - follows at the end

On my system it's:
C:\Program Files\Apache software foundation\Apache2.2\htdocs
C:\Program Files\Apache software foundation\Apache2.2\cgi-bin

Frank

#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "C:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the
# server as "C:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
ThreadsPerChild 250
MaxRequestsPerChild 0

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk. If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin admin@home

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName sidney.home:80

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog logs/access.log common

#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog logs/access.log combined
</IfModule>

<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://sidney.home/bar

#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"

</IfModule>

#
# "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

#
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script. For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

#!c:/program files/perl/perl

# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file. Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention. The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab. Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry
#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.
#

#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types

#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

# For type maps (negotiated resources):
#AddHandler type-map var

#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile conf/magic

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://sidney.home/subscription_info.html
#

#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall is used to deliver
# files. This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
#
#EnableMMAP off
#EnableSendfile off

# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.

# Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf

# Multi-language error messages
#Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
#Include conf/extra/httpd-autoindex.conf

# Language settings
#Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
#Include conf/extra/httpd-dav.conf

# Various default settings
#Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

rafiki
06-26-2007, 06:20 PM
Frank, why not learn PHP instead of Perl, as far as i know its just as functional, easy to set up, popular so get fast help, and easier to learn..
i would suggest PHP to you my friend.

KevinADC
06-26-2007, 07:52 PM
I'm going to end my participation in this thread. I honestly think Frank needs only one person to help him, with two/three people, sometimes offering contradictory suggestions and advice, I am sure he gets frustrated and maybe confused. Since I do not think XAMPP is the way to go, I think FishMonger should be left to assist Frank at this point. Of course that is all just my opinion and anyone that wants to continue helping Frank should do so. No offense to anyone, the amount of assistance that has gone into this thread by everyone involved is impressive and I am sure appreciated. All the best to Frank.

Kevin

effpeetee
06-26-2007, 08:16 PM
Rafiki,
My problem is not with Perl but with Apache. I may well learn php later but I can not do anything until Apache is running properly.

Kevin,

Many thanks for your input. It has been interesting and not confusing. What I found confusing was that Apache supply a config file which they then follow with a long text on how to put it right. Why not publish a correct config for download. My biggest problem is with my sight. It is showing its' age.

I find it very difficult to read from the screen, especailly text such as the config file is.

Happy coding to you all.

Frank

FishMonger
06-26-2007, 08:55 PM
When installing apache, it's best to accept all of the defaults and only do otherwise if you know exactly what that change would do. With a default install only 2 items in the conf file need to be changed, but all settings should be checked to make sure they're set correctly.

This is the only section that is normally changed.
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin admin@home

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName sidney.home:80
In your case, you need to change the ServerName to be your IP address or localhost instead of sidney.home:80
e.g.,
ServerName localhost:80
or
ServerName 192.168.0.10

The ServerAdmin is not really that important, but should be set to your actual email address

The conf file you posted in incomplete. Farther down is the ScriptAlias section that specifies where your perl scripts need to go and the directory alias that will be used. The default alias is cgi-bin but it could instead be cgi

Here's an example from one of my systems.
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"

#
# "C:/Program Files/Apache Group/Apache2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>


Finally, the shebang line in your scripts (line number 1) needs to have the full and correct path to perl.exe which the default on windows would be:
#!C:/perl/bin/perl.exeNote, I'm using forward slashes instead of backslashes.

effpeetee
06-26-2007, 10:34 PM
FishMonger,

I have done all that is in your post and this is what I get!

Forbidden
You don't have permission to access /cgi-bin/perltest.cgi on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.2 Server at localhost Port 80

This is something new for this.

Windows XP Pro.

Frank.

I am just off to bed (to recover)
I'll try to find out why, in the morning.

Many thanks for your help.

effpeetee
06-27-2007, 08:34 AM
This morning I did not get the Access forbidden message, just an error 404, site cannot be found.

I have included the Apache config file (less comments) in the hope that someone can see an error.

NOTE that Apache works if I use XAMPP. I just cannot get it working consistently from the Apache.com source.

This is the main Apache HTTP server configuration file.

ThreadsPerChild 250
MaxRequestsPerChild 0

ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"

Listen 80

LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule userdir_module modules/mod_userdir.so

ServerAdmin frankptaylor@btinternet.com

ServerName localhost:80

DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
.
Options Indexes FollowSymLinks


AllowOverride None

Order allow,deny
Allow from all

</Directory>

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

ErrorLog logs/error.log

LogLevel warn

<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

CustomLog logs/access.log common

</IfModule>

<IfModule alias_module>
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"

</IfModule>

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

DefaultType text/plain

<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

</IfModule>


<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

FishMonger
06-27-2007, 08:40 AM
Frank,

The httpd.conf file in the version of Apache that you installed has had a number of improvements since the older version that I have on my home system. Since mine was corrupted due to a failed upgrade of some of its components, I decided to install the newer version. If you enter your proper info into the dialog box during the default install, you will not need to make any adjustments to the conf file to have a working installation.

Since you're still receiving errors, your installation may be corrupt due to the attempted installation of XAMPP (i.e., there may be some conflicting registry settings). We can probably make some adjustments to get it working, but it might be better to uninstall Apache, reboot and then reinstall. After uninstalling, you should verify that the Apache and XAMPP directories have been deleted before you reinstall Apache. This should only take about 10 minutes.

Once you've reinstalled Apache, test to see if the default index.html file that it installs works.
http://localhost/

If you receive an error, open up the error.log file and post the error messages so I can review them.

If you get the It works! page, then test a cgi script.

In the cgi-bin directory you should have a script called printenv.cgi. Make sure the first line has the correct path to Perl and then try to call it up in the browser.
http://localhost/cgi-bin/printenv.cgi

If you receive an error, post the lines from the error.log file.

If it works, then try this script (name it tryit.pl and save it in the cgi-bin dir):
#!C:/Perl/bin/perl.exe

use CGI ':standard';

print header;
print start_html('A Simple Example'),
h1('A Simple Example'),
start_form,
"What's your name? ",textfield('name'),
p,
"What's the combination?",
p,
checkbox_group(-name=>'words',
-values=>['eenie','meenie','minie','moe'],
-defaults=>['eenie','minie']),
p,
"What's your favorite color? ",
popup_menu(-name=>'color',
-values=>['red','green','blue','chartreuse']),
p,
submit,
end_form,
hr;

if (param()) {
print
"Your name is: ",em(param('name')),
p,
"The keywords are: ",em(join(", ",param('words'))),
p,
"Your favorite color is: ",em(param('color')),
hr;
}
print end_html;

FishMonger
06-27-2007, 08:43 AM
NOTE that Apache works if I use XAMPP. I just cannot get it working consistently from the Apache.com source.
Does that mean that you have both installed at the same time? If so, then that's going to cause problems.

We need to see the error.log file!!

effpeetee
06-27-2007, 09:38 AM
Does that mean that you have both installed at the same time? If so, then that's going to cause problems.

We need to see the error.log file!!
Where do I find it?
There is an error directory in Apache but all the entries and dated in 2005! and have a .var suffix.

NO. I do not have both XAMPP and Apache in the PC together. You would not believe the number of times that I have installed/removed both programs. BUT NEVER both in the PC together.

Frank

effpeetee
06-27-2007, 09:53 AM
Is this it?

[Wed Jun 27 05:45:36 2007] [notice] Apache/2.2.4 (Win32) configured -- resuming normal operations
[Wed Jun 27 05:45:36 2007] [notice] Server built: Jan 9 2007 23:17:20
[Wed Jun 27 05:45:36 2007] [notice] Parent: Created child process 328
[Wed Jun 27 05:45:37 2007] [notice] Child 328: Child process is running
[Wed Jun 27 05:45:37 2007] [notice] Child 328: Acquired the start mutex.
[Wed Jun 27 05:45:37 2007] [notice] Child 328: Starting 250 worker threads.
[Wed Jun 27 05:45:37 2007] [notice] Child 328: Starting thread to listen on port 80.
[Wed Jun 27 05:54:46 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:54:49 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:54:51 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:54:52 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:54:52 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:54:52 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:54:56 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 05:55:11 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 05:55:13 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 05:55:14 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 05:55:15 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 05:55:19 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 05:55:19 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 05:56:38 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:56:41 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:56:43 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:56:44 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:56:47 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:57:01 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cpl
[Wed Jun 27 05:58:05 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:58:09 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:58:10 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:58:11 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:58:12 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 05:58:13 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 06:04:56 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:09:14 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 06:09:35 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 06:09:38 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 06:09:53 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:09:57 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:09:58 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:09:59 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:11:27 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:11:29 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:11:31 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:11:42 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 06:11:45 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 06:11:46 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 06:11:58 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:12:01 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:12:02 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:12:02 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:12:03 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cpl
[Wed Jun 27 06:12:21 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't create child process: 720003: clock.pl
[Wed Jun 27 06:12:21 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't spawn child process: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.pl
[Wed Jun 27 06:12:30 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't create child process: 720003: clock.pl
[Wed Jun 27 06:12:30 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't spawn child process: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.pl
[Wed Jun 27 06:12:42 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:12:43 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:12:44 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:12:44 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:12:44 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:13:01 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:13:02 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 06:13:03 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 07:02:09 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 07:02:11 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 07:02:12 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 07:02:14 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 07:02:37 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:05:44 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:05:47 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:05:49 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:05:49 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:05:50 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:05:56 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 07:06:05 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:06:34 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 07:06:37 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 07:06:39 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 07:06:39 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/perltest.cgi
[Wed Jun 27 07:50:16 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:50:47 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:50:49 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:50:52 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:50:54 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:50:54 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 07:51:06 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 08:03:50 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 08:41:23 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 09:44:20 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/perltest.cgi
[Wed Jun 27 09:45:31 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:47:05 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Documents
[Wed Jun 27 09:47:08 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Documents
[Wed Jun 27 09:47:20 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:47:23 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:47:27 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:47:29 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:47:29 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:48:16 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:48:41 2007] [error] [client 127.0.0.1] attempt to invoke directory as script: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/
[Wed Jun 27 09:48:54 2007] [error] [client 127.0.0.1] attempt to invoke directory as script: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/
[Wed Jun 27 09:49:07 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:49:11 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:49:26 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgi
[Wed Jun 27 09:49:41 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't create child process: 720003: clock.pl
[Wed Jun 27 09:49:41 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't spawn child process: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.pl

FishMonger
06-27-2007, 04:52 PM
Yes, that's it and it gives us the info we need.

Let's look at the last few lines.
Wed Jun 27 09:49:26 2007] [error] [client 127.0.0.1] script not found or unable to stat: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.cgiThat line tells me that you entered the correct url path of http://localhost/clock.cgi and Apache was looking for the script in C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/ but couldn't find it in that directory. Which tells me that you put the script in the wrong place. Are the XAMP directories still there and did you put the script under that cgi-bin?

These last 2 lines :[Wed Jun 27 09:49:41 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't create child process: 720003: clock.pl
[Wed Jun 27 09:49:41 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't spawn child process: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.pl
tells me that the clock.cgi script is now in the correct cgi-bin directory but the shebang line has the wrong path to perl which means Apache doesn't know where to find the Perl interpreter that it needs to process the script. If Activestate's default install directory is the same as was when I last installed, the shebang line should be this:#!C:/Perl/bin/perl.exeYou should double check the path on your system and set the shebang line accordingly.

KevinADC
06-27-2007, 05:23 PM
Apache's cgi-bin directory is NOT a sub directory of htdocs. They are parallel to each other.

Is that how it is with Apache 2.X? I still run the older 1.3 on my local test server and the http accessible cgi-bin is a subfolder of htdocs.

FishMonger
06-27-2007, 05:36 PM
That's odd, it never has been on any of my installs. In fact, according to all docs that I've ever read, it should never be under the DocumentRoot because that would open up some security holes. Do you have a separate www dir under htdocs that is parallel to cgi-bin?

EDIT:
BTW, 1.3 is fairly old, you may want to upgrade.

KevinADC
06-27-2007, 05:43 PM
BTW, 1.3 is fairly old, you may want to upgrade.

hehehe... I am version 50.1, can I upgrade myself?

KevinADC
06-27-2007, 05:45 PM
That's odd, it never has been on any of my installs. In fact, according to all docs that I've ever read, it should never be under the DocumentRoot because that would open up some security holes. Do you have a separate www dir under htdocs that is parallel to cgi-bin?

EDIT:
BTW, 1.3 is fairly old, you may want to upgrade.

All or nearly all hosted sites are like that no? The cgi-bin is a sub folder of the www or public_html folder.

FishMonger
06-27-2007, 05:49 PM
hehehe... I am version 50.1, can I upgrade myself?
I'm on version 49.6 I think I've had more upgrades that I want. :)

FishMonger
06-27-2007, 05:55 PM
All or nearly all hosted sites are like that no? The cgi-bin is a sub folder of the www or public_html folder.
All hosting sites that I've worked with have them parallel to each other.

/home/user/(www|public_html)/htdocs
/home/user/(www|public_html)/cgi-bin

effpeetee
06-27-2007, 06:12 PM
[These last 2 lines :
Quote:
[Wed Jun 27 09:49:41 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't create child process: 720003: clock.pl
[Wed Jun 27 09:49:41 2007] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn't spawn child process: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/clock.pl

tells me that the clock.cgi script is now in the correct cgi-bin directory but the shebang line has the wrong path to perl which means Apache doesn't know where to find the Perl interpreter that it needs to process the script. If Activestate's default install directory is the same as was when I last installed, the shebang line should be this:
Quote:
#!C:/Perl/bin/perl.exe

You should double check the path on your system and set the shebang line accordingly.
Fishmonger,

Rather a lot to take in at short notice. I'll sort it out as per your advice and let you all know later.

Frank

KevinADC
06-27-2007, 06:41 PM
All hosting sites that I've worked with have them parallel to each other.

/home/user/(www|public_html)/htdocs
/home/user/(www|public_html)/cgi-bin

My experience has been the exact opposite. Most sites have them in the public_html folder:

public_html/cgi-bin

KevinADC
06-27-2007, 06:50 PM
I'm on version 49.6 I think I've had more upgrades that I want. :)

Maintenance does not count as upgrades ;)

FishMonger
06-27-2007, 07:31 PM
Maintenance does not count as upgrades ;)

Well, I've had my clock upgraded to include some bionics that will never ware out (stainless steal valve)! Does that count? :)

KevinADC
06-27-2007, 08:36 PM
Well, I've had my clock upgraded to include some bionics that will never ware out (stainless steal valve)! Does that count? :)

Maybe, though it could fall into the category of mantenance. If they put the valve in and changed your name to "The Six Million Dollar FishMonger" then it would definetly be an upgrade. :thumbsup:

I had one of my eyes replaced with a prosthetic eye (commonly called a glass-eye although there is no glass in them). At least your upgrade is functional!

;) <-- I'm not winking, I just don't have my glass-eye in :D

effpeetee
06-28-2007, 09:19 AM
This is in the nature of desparation. I cannot get perl to work on my PC.


Would somebody tell me how to instal and where to put my scripts.
I have removed Apache and Perl and XAMPP from the computer and erased the program files. I have also defragged. As free and clean as I can make it.

I have Windows XP Professional installed with all updates.

Assuming that I know very little about how to install and in what order to install. Tell me what to do.

If this post does not finally get Perl working on my PC, I will give up.

Thanks

Frank - alias effpeetee

rafiki
06-28-2007, 11:50 AM
Frank, why not learn PHP instead of Perl, as far as i know its just as functional, easy to set up, popular so get fast help, and easier to learn..
i would suggest PHP to you my friend.

Frank honestly take this advice this is good advice, php pwns perls :P

effpeetee
06-28-2007, 12:10 PM
But I cannot get Apache to work properly.
I need that whatever I use.

The help site http://www.cgi101.com/book/connect/winxp.html

Gives some advice which is not specific enough and does not seem to fit in with the config page that I have. One of the lines of code which it says is needed to add, Wherever I put it, it is rejected during the installation. I have spent nearly three whole days trying with no real success. In over 10 years of computing, I have never been so frustrated. I just don't know what else I can do.

GRrrr!

My thanks to you all for you help and support.

Frank

mlseim
06-28-2007, 01:29 PM
I talked to Frank privately (through email) about using PHP, and provided
a very simple example that he did try.

I explained that although Perl is very powerful, and obviously has its place,
PHP would be so much easier for a "novice" programmer.

It's my thought that he wants to do a bunch of programming and development
offline, and has latched onto the Perl thing. Not so much to develop his
website, but to dive into a new learning experience. The big picture is he's
an old electronics tinkerer who can't get enough ... and hats-off to him for
taking on such a big thing at 80+ years old.

So, I hope he gets all of this Perl installation working, but once done, I'm
not sure what he'll do with it. When it comes back to working on his
website, I think Perl will end up being somewhat of an overkill for what he
wants to do on his site ... so the PHP hat goes back on?

But, this post's journey has been interesting ... something different
for once. I was getting tired of "contact forms".

effpeetee
06-28-2007, 01:50 PM
I talked to Frank privately (through email) about using PHP, and provided
a very simple example that he did try.

I explained that although Perl is very powerful, and obviously has its place,
PHP would be so much easier for a "novice" programmer.

It's my thought that he wants to do a bunch of programming and development
offline, and has latched onto the Perl thing. Not so much to develop his
website, but to dive into a new learning experience. The big picture is he's
an old electronics tinkerer who can't get enough ... and hats-off to him for
taking on such a big thing at 80+ years old.

So, I hope he gets all of this Perl installation working, but once done, I'm
not sure what he'll do with it. When it comes back to working on his
website, I think Perl will end up being somewhat of an overkill for what he
wants to do on his site ... so the PHP hat goes back on?

But, this post's journey has been interesting ... something different
for once. I was getting tired of "contact forms".
mlseim ,

I am ready and willing to use PHP, but I am right am I not, that I still need Apache or another server before I can try either. I have been unable to get Apache to configure successfully. I have had much advice and have faithfully tried everything. I have installed and uninstalled Perl and Apache more times than I like to remember.

I am totally frustrated because even the advice from an official source is ambiguous. It suggests that Windows XP needs an additional config.

User Directory - whatever

also that a Directory section need copying in as well.

I have tried to use it in every conceivable position; all of which were rejected by Apache.

But why all the complicated explanations, when a simple replacement config file would have been so much simpler. J am a great believer in the KISS regime.

Keep It Simple Sir.

Well, I thank you all for you kindness and expertise. I just wish for all out sakes that it had produced a successful outcome.

Frank

effpeetee
06-29-2007, 11:25 AM
Assuming that I have Apache and PHP working properly on my PC; how would I then run a php script on my PC.

Say "Frank.php"

Thanks

Frank

mlseim
06-29-2007, 12:58 PM
Frank ...

See this:
http://www.wikihow.com/Install-Apache,-MySQL,-PHP,-and-phpMyAdmin-on-a-Windows-PC


and this:
http://www.google.com/search?hl=en&q=running+php+on+pc&btnG=Google+Search

rafiki
06-29-2007, 02:02 PM
go back to XAMPP for PHP i used to use it locally, for what im doing at the moment i use a server which will host the site anyway, so no point in testing locally straining my resources when i can upload with two clicks to the site it will be uploaded to anyway

effpeetee
06-29-2007, 02:23 PM
Frank ...

See this:
http://www.wikihow.com/Install-Apache,-MySQL,-PHP,-and-phpMyAdmin-on-a-Windows-PC


and this:
http://www.google.com/search?hl=en&q=running+php+on+pc&btnG=Google+Search
Sorry,

I've been there; done it - many times. None of them work for me.
I have over fifty pages of so called "Help" that I have printed off. just a waste of paper.
I went to an Apache blog. One of the punters there has been trying over eighteen months - on and off - and still has not succeeded. Not a very good installation package is it?

Frank

effpeetee
06-29-2007, 02:25 PM
go back to XAMPP for PHP i used to use it locally, for what im doing at the moment i use a server which will host the site anyway, so no point in testing locally straining my resources when i can upload with two clicks to the site it will be uploaded to anyway
I can't get Xampp to work with php.

Been trying for hours.
it is apparently OK in that it shows the index,html, but wherever I put my script, it cannot find it.

Frank

rafiki
06-29-2007, 03:13 PM
for php docs u put Frank.php (example) in htdocs the online directory is then http://localhost/Frank.php

<?php
echo "PHP Is Okay.";
?>

whack that in Frank.php and move it to htdocs (inside the XAMPP folder) and click the link
http://localhost/Frank.php
see if it says PHP Is Okay on a blank page with nothing else on.

effpeetee
06-29-2007, 04:27 PM
for php docs u put Frank.php (example) in htdocs the online directory is then http://localhost/Frank.php

<?php
echo "PHP Is Okay.";
?>

whack that in Frank.php and move it to htdocs (inside the XAMPP folder) and click the link
http://localhost/Frank.php
see if it says PHP Is Okay on a blank page with nothing else on.
Yes Rafiki,, it works fine if called from my browser. But if I call it via a hyperlink from my index page, I just get a blank page.

However, that is much more than I have been able to do previously.

Have you any idea how I can call it from my PC based website, if it's possible.

Very many thanks. I can now move on and learn PHP.

It was just the practical things that I didn't know.

Happy coding.

Frank