logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Cannot connect to MySql db After Apache 2.2 Reinstall

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Fri 01 Feb '19 0:48    Post subject: Cannot connect to MySql db After Apache 2.2 Reinstall Reply with quote

My Apache2.2.11 was running perfectly on Windows Server 2012 for 3 years when it suddenly crashed and had to be reloaded. I have a website (virtual host) on Apache and a Mysql database on the same drive. After reloading the Apache with what I thought was the exact Httpd config I am unable to get my PERL cgi programs to connect to the database even though the PERL and Mysql files appear to be exactly as they were previously. The Mysql database is live and can be accessed remotely and inquiries made at the command prompt. Consequently I think something is amiss in the Apache Httpd config file. Any suggestions as to where my problem lies will be sincerely appreciated. Thanks!

Milt Spain
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6552
Location: Germany, Next to Hamburg

PostPosted: Fri 01 Feb '19 9:50    Post subject: Reply with quote

You should upgrade to Apache 2.4. The 2.2 version is no longer supported.

Anything in the apache error log? Windows event log? PHP error log?
Back to top
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Fri 01 Feb '19 14:48    Post subject: Reply with quote

Just got these. First time I've seen them.

[Fri Feb 01 06:40:59 2019] [error] [client 97.124.80.68] E:/Pinnacle/DiversityLink/cgi-bin/member_selections_htm.pl is not executable; ensure interpreted scripts have "#!" first line, referer: http://www.diversitylink.com/cgi-bin/showmenu2.pl
[Fri Feb 01 06:40:59 2019] [error] [client 97.124.80.68] (9)Bad file descriptor: don't know how to spawn child process: E:/Pinnacle/DiversityLink/cgi-bin/member_selections_htm.pl, referer: http://www.diversitylink.com/cgi-bin/showmenu2.pl
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6552
Location: Germany, Next to Hamburg

PostPosted: Fri 01 Feb '19 16:15    Post subject: Reply with quote

If you open one of those files with for example Notepad++ do you see the correct line ending for Windows?
Back to top
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Fri 01 Feb '19 17:31    Post subject: Reply with quote

Not sure what you mean by "correct line ending for Windows" but the programs all ran perfectly previously. Here is the begining lines of one program:

##memberselections.pl
#!C:/Perl/bin/perl -w
use strict;
use CGI qw(:standard);
###print "content-type: text/html\n\n";
use DBI;
my ($dbh, $sth);

my $AccountID=param('AccountID');
my $PW=param('Password');

$dbh = DBI->connect('dbi:mysql:membersdb','member','memberpasswd') || die "cannot open";
$sth = $dbh->prepare("SELECT PW FROM memberid WHERE AccountID=? ");
$sth->execute ($AccountID);

An example of a cgi file that does work is:
http://www.diversitylink.com/cgi-bin/Global/USA/USA_statetoc.pl

The only programs that I cannot get to work are those that connect to the database or those that are protected by htaccess. All worked previously.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2187
Location: Sun Diego, USA

PostPosted: Sun 03 Feb '19 20:16    Post subject: Reply with quote

#!C:/Perl/bin/perl -w

That (shebang) needs to be the first line of a perl script.

However you were probably using ScriptInterpreterSource in your prior config which removes that requirement.
Back to top
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Sun 03 Feb '19 21:27    Post subject: Reply with quote

You are 100% correct!! Thanks!
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1