LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 12-12-2005, 03:55 AM   #1
green_njk
LQ Newbie
 
Registered: Dec 2005
Posts: 20

Rep: Reputation: 0
The connection was refused when attempting the localhost


When I want to run the PHP code i got the prolem was

The connection was refused when attempting the localhost

Then I'm trying to start the httpd server. But it gives one error.

That error is :

httpd failed. The error was: Starting httpd: Syntax error on line 6 of /etc/httpd/conf.d/auth_mysql.conf:
Cannot load /etc/httpd/modules/mod_auth_mysql.so into server: libmysqlclient.so.10: cannot open shared object file: No such file or directory
[FAILED]


any one help me.
 
Old 12-12-2005, 10:06 AM   #2
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Rep: Reputation: 88
I think you need to install MySQL and the Apache MySQL module. Or else if you don't need MySQL just remove the module from Apache configuration and try again.

What distro and version of Apache are you using by the way?
 
Old 12-12-2005, 04:39 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,408

Rep: Reputation: 108Reputation: 108
Moved: This thread is more suitable in Linux-Software and has been moved accordingly to help your thread/question get the exposure it deserves.

It looks you don't have MySQL installed. Please check it. Alternatively, if you don't want to use a database, you may remove MySQL support from Apache and use it in that configuration. Do you need MySQL or not?
 
Old 12-12-2005, 04:53 PM   #4
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 45
It's not just mysql, but you need the myslq-shared-compat package. That package provides the libmysqlclient.so.10 file you're missing. There used to be 2 different shared library packages - mysql-shared-compat, and myslq-shared. If you installed the first, you didn't need to install the latter. If you get the packages from mysql directly, I believe that last linux rpm version that had that package was 4.1.13. 4.1.15 had the package also, but it looks like mysql changed their site and have taken the package out. It also looks like you won't be able to find previous versions of mysql on mysql's site.

the difference between mysql version 4.1.13 and the higher versions, is that the higher versions use glibc2.3, so if you're running an old rpm distro like redhat 7.3, you're last availbe version of mysql is 4.1.13. Although, it doesn't seem to matter now since the shared compat package is no longer listed.

Now bear in mind, I'm only talking about the packages from mysql's site. Your distro might package things up differently.

Of course, you can always try rebuilding the source.
 
Old 12-12-2005, 11:18 PM   #5
green_njk
LQ Newbie
 
Registered: Dec 2005
Posts: 20

Original Poster
Rep: Reputation: 0
I fixed that problem.

Thanks for ur reply.

I reinstalled the mod_auth_mysql-20030510-4.1.src.rpm package, the connection was refused problem was gone. But I got another problem which is Call to undefined function: mysql_connect()


Any one help me.
 
Old 12-13-2005, 01:04 AM   #6
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 45
you don't have a problem with mod_auth_mysql. You have a problem with not having mysql installed and in particular the shared-compat package.

look at http://www.mysql.com/ or your distros repository for mysql packages.

or disable loading that module in your httpd.conf, as was suggested in a previous post.
 
Old 12-13-2005, 11:22 PM   #7
green_njk
LQ Newbie
 
Registered: Dec 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Call to undefined function:mysql_connect()

When i run php file without mysql content ,it runs properly.

When i connect mysql in bash terminal, it connects properly.

When i run php file with mysql content, i got Call to undefined

function:mysql_connect()
error. I dont know which package i have to installed.

I installed follwoing mysql rpms:

MySQL-shared-5.0.16-0.glibc23

MySQL-client-5.0.16-0.glibc23

MySQL-devel-5.0.16-0.glibc23

MySQL-server-5.0.16-0.glibc23

MySQL-bench-5.0.16-0.glibc23

I installed follwoing php rpms:

php-ldap-4.3.2-8.ent

php-mysql-4.3.2-8.ent

php-odbc-4.3.2-8.ent

php-imap-4.3.2-8.ent

php-pgsql-4.3.2-8.ent

Where did i wrong? Help me.
 
Old 12-14-2005, 06:11 PM   #8
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 45
I told you, you need the mysql-shared-compat package. It looks like mysql have taken that package out from their download site. Normally you wouldn't install MySQL-shared-5.0.16-0.glibc23 if you installed the MySQL-shared-compat package. The last version of MySQL I've seen that had the compatibility package was 4.1.13. Check the web if you can find that package. If not, give me a holler and I'll find out some way of getting it to you.
 
Old 12-14-2005, 06:36 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 9,919

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
Verify in your php.ini file that the following line is not commented out.
extension=mysql.so

I assume that php was compiled with mysql
 
Old 12-14-2005, 10:33 PM   #10
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 45
installing php from rpms, I don't know as I've always compiled php from source. The default php.ini file should work as is if compiled from source. Definately check your php.ini file, but if you want, uninstall the php rpms you installed and compile the source code instead. Things should definately work out better for you.

The ./configure command I used (note I couldn't figure out how to get snmp compiled in so that's omitted):

Code:
./configure --with-apxs2=/usr/local/Apache2.2.X/bin/apxs --with-mysql --prefix=/usr --with-config-file-path=/etc --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext --with-gdbm --with-openssl --with-dom=/usr/include/libxml12 --with-unixODBC=/usr --with-imap=/usr --with-ldap --with-dom --with-dom-xslt --with-dom-exslt --with-kerberos --with-imap-ssl --enable-ucd-snmp-hack
use the correct path to the base install directory of your apache install when using the --with-apx2 option.

*edit: also of note, there's a lot of options I use and you'll have to get the packages for things like the correct version of libxml (or libxml2), unixODBC, etc...

then type:

make
su
<enter root password>
make install

'make install' will install the correct libphp5.so and libphp5.la apache modules in the right location (/install/path/to/apache/modules) and will put in the correct load module line in httpd.conf.

With mysql, I do use the rpms, but with apache I always compile that from source, as well.

Last edited by megaspaz; 12-14-2005 at 10:36 PM.
 
Old 12-16-2005, 06:47 AM   #11
green_njk
LQ Newbie
 
Registered: Dec 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Regarding PHP-Mysql connectivity

I installed mysql_shared_compat package. Still i couldnt connect mysql thru PHP.

I dont know where did i wrong? Help me.
 
Old 12-16-2005, 10:18 AM   #12
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 45
run this command and paste the output.

rpm -qa | grep MySQL
 
Old 12-16-2005, 11:59 PM   #13
green_njk
LQ Newbie
 
Registered: Dec 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Still i couldnt connect mysql thru PHP

I run this rpm -qa | grep MySQL.

I got following output.

MySQL-shared-compat-4.0.17-0
perl-DBD-MySQL-2.1021-3
MySQL-server-4.0.17-0
MySQL-shared-4.0.17-0
MySQL-client-4.0.17-0

Still i couldnt connect mysql thru PHP

Help me.
 
Old 12-17-2005, 12:06 AM   #14
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
make sure that sql is running
Code:
# ps ax | grep sql
make sure that you can connect to the sql server
http://www.linuxquestions.org/questi...d.php?t=230791
 
Old 12-17-2005, 12:34 AM   #15
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 45
Quote:
Originally Posted by uberNUT69
make sure that sql is running
Code:
# ps ax | grep sql
make sure that you can connect to the sql server
http://www.linuxquestions.org/questi...d.php?t=230791
good call, although I'm pretty sure that after installing the rpms, it starts up mysqld and adds in an init service.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
connection was refused when attempting to contact localhost wolsue Linux - Networking 1 10-30-2005 01:36 AM
The connection was refused when attempting to contact localhost:901 budhead Linux - Networking 6 09-05-2004 04:11 PM
Connection to localhost refused?!? a_priebe47 Slackware 4 09-01-2004 09:05 PM
connection to localhost refused digitalgravy Linux - Networking 5 05-03-2004 04:27 PM
SAMBA & SWAT - Connection refused when attempting to connect Localhost:901 ScooterB Linux - Networking 3 12-24-2003 04:15 PM


All times are GMT -5. The time now is 09:34 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration