It would seem that way, but something strange is going on...
When the CGI connects to mySQL on the same box via /tmp/mysql.sock, the script works fine. When I change it to connect via port 3306, I get this error.
Now you showed me something interesting... The problem in /home/httpd/cgi-bin/debugmwslib.pl. This is not the script location -- it is /home/httpd/cgi-bin/mws/debugmwslib.pl, and it is the same location where I run it from (eg. http://192.168.0.2/cgi-bin/mws/debugmwslib.pl).
</home/httpd/cgi-bin/debugmwslib.pl
I do not have any redirection HTML code.
Here's the script output when I run it from the command line (trying port 3306)
root@morpheus:/home/httpd/cgi-bin/mws# ./debugmwslib.pl
Content-type: text/html
DBI->connect(database=mwsdb;host=192.168.0.2) failed: Timeout of authe
+ntication at /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/DBD/mysqlP
+P.pm line 109
at mwslib.pl line 1145
<html>
<link REL="STYLESHEET" TYPE="text/css" HREF="/mwsstyle.css">
<head>
<META HTTP-EQUIV="Expires" CONTENT="Tue, 2 Jan 1996 12:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
</head>
<h1>Massyn Web Security</h1>
Can't call method "prepare" on an undefined value at mwslib.pl line 97
+7.
Compilation failed in require at ./debugmwslib.pl line 4.
root@morpheus:/home/httpd/cgi-bin/mws#
As said previously, when I connect to "localhost", everything works fine. I'm really confused why this is happening, and I really need to split the database and web server components.
Thanks!
#!/massyn.pl
The more I learn, the more I realize I don't know.
Albert Einstein 1879-1955 |