# apache and mysql problem(solved)

## swingarm

I have Egroupware, PHP4, mysql, and apache 1.3 installed.  Everytime I try to start apache I get this:

```

[Thu Sep  1 13:34:28 2005] [alert] mod_unique_id: unable to gethostbyname("hopecentre2")

PHP Warning:  Function registration failed - duplicate name - mssql_connect in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_pconnect in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_close in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_select_db in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_query in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_free_result in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_get_last_message in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_num_rows in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_num_fields in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_fetch_field in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_fetch_row in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_fetch_array in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_fetch_object in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_data_seek in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_field_seek in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_result in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_min_error_severity in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_min_message_severity in Unknown on line 0

PHP Warning:  mssql:  Unable to register functions, unable to load in Unknown on line 0

[Thu Sep  1 13:37:58 2005] [alert] mod_unique_id: unable to gethostbyname("hopecentre2")

```

I don't know hardly anything to debug this, any help appreciated.Last edited by swingarm on Sat Sep 17, 2005 9:12 pm; edited 1 time in total

----------

## hanj

Can you show us the output of...

```
emerge -pv apache mysql
```

also..

```
emerge info
```

also...

```
rc-status
```

thanks

hanji

----------

## swingarm

emerge -pv apache mysql:

```

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-www/apache-1.3.33-r1  +pam (-selinux) +ssl 0 kB

[ebuild   R   ] dev-db/mysql-4.0.24  +berkdb -debug -innodb +perl +readline (-selinux) +ssl -static +tcpd 0 kB

Total size of downloads: 0 kB

```

emerge info:

```

Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.12-gentoo-r4 i686)

=================================================================

System uname: 2.6.12-gentoo-r4 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz

Gentoo Base System version 1.6.12

dev-lang/python:     2.3.5

sys-apps/sandbox:    1.2.10

sys-devel/autoconf:  2.13, 2.59-r6

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5

sys-devel/binutils:  2.15.92.0.2-r10

sys-devel/libtool:   1.5.18-r1

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks sandbox sfperms strict"

GENTOO_MIRRORS="ftp://gentoo.chem.wisc.edu/gentoo/ http://gentoo.mirrors.easynews.com/linux/gentoo/ http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/gentoo http://gentoo.seren.com/gentoo"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 alsa apache apm arts avi berkdb bitmap-fonts crypt cups emboss encode foomaticdb fortran freetds gdbm gif gpm imlib ipv6 jpeg libg++ libwww mad mikmod mmx motif mp3 mpeg mssql mysql ncurses nls oggvorbis opengl oss pam pdflib perl php png python qt quicktime readline sdl spell sse ssl tcpd tiff truetype truetype-fonts type1-fonts xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY

```

rc-status:

```

Runlevel: default

 sshd                                                                                                            [ started ]

 local                                                                                                           [ started ]

 mysql                                                                                                           [ started ]

 vixie-cron                                                                                                      [ started ]

 syslog-ng                                                                                                       [ started ]

 apache                                                                                                            [   off ]

 coldplug                                                                                                        [ started ]

 hdparm                                                                                                          [ started ]

 net.eth0                                                                                                        [ started ]

 ez-ipupdate                                                                                                       [   off ]

 netmount                                                                                                        [ started ]

 webmin                                                                                                          [ started ]

 hotplug                                                                                                         [ started ]

```

It should also be noted that it was working fine then, as far as I can tell, stopped.

----------

## hanj

can you give me the output of:

```
emerge -pv mod_php php
```

also:

```
php -v
```

I'm wondering if your php.ini file is messed up.. here are some links with people having similar problems:

http://lists.ibiblio.org/pipermail/freetds/2005q2/018649.html

http://www.gt-templates.com/archive/index.php/t-13837.html

hanji

----------

## swingarm

sorry I took so long to reply but here's the info you requested:

emerge -pv mod_php php:

```

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] dev-php/mod_php-4.3.11  -X -apache2 +berkdb +crypt -curl -debug -doc -fdftk -firebird -flash +freetds -gd -gd-external +gdbm -gmp -hardenedphp -imap -informix +ipv6 -java +jpeg -kerberos -ldap -mcal -memlimit +mssql +mysql +nls -oci8 -odbc +pam +png -postgres -snmp +spell +ssl +tiff +truetype +xml2 -yaz 0 kB

[ebuild   R   ] dev-php/php-4.3.11  -X +berkdb +crypt -curl -debug -doc -fdftk -firebird -flash +freetds -gd -gd-external +gdbm -gmp -hardenedphp -imap* -informix +ipv6 -java +jpeg -kerberos -ldap -mcal -memlimit +mssql +mysql +ncurses +nls -oci8 -odbc +pam +png -postgres +readline -snmp +spell +ssl +tiff +truetype +xml2 -yaz 0 kB

Total size of downloads: 0 kB

```

php -v:

```

PHP Warning:  Function registration failed - duplicate name - mssql_connect in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_pconnect in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_close in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_select_db in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_query in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_free_result in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_get_last_message in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_num_rows in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_num_fields in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_fetch_field in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_fetch_row in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_fetch_array in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_fetch_object in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_data_seek in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_field_seek in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_result in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_min_error_severity in Unknown on line 0

PHP Warning:  Function registration failed - duplicate name - mssql_min_message_severity in Unknown on line 0

PHP Warning:  mssql:  Unable to register functions, unable to load in Unknown on line 0

PHP 4.3.11 (cli) (built: Aug 13 2005 10:36:40)

Copyright (c) 1997-2004 The PHP Group

Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

```

You also wondered if my php.ini was corrupted or had an error in it?  The entry listed below is the only change I made to that file:

```

mbstring.func_overload = 7

```

----------

## swingarm

*bump*

Really don't want to rebuild this computer if I can help it.

----------

## minskpower

I remember seeing an explicit warning somewhere about compiling php with mssql and some other db support (warning was about some compiling colisions, but I can't remember what was it about).

I would try to re-emerge php without mssql support (unless you really need mssql, then you have to search and remove support for the feature it collides with).

```

USE="-mssql" emerge -av mod_php php

```

----------

## swingarm

 *minskpower wrote:*   

> I remember seeing an explicit warning somewhere about compiling php with mssql and some other db support (warning was about some compiling colisions, but I can't remember what was it about).
> 
> I would try to re-emerge php without mssql support (unless you really need mssql, then you have to search and remove support for the feature it collides with).
> 
> ```
> ...

 

I really wished that was it but,  no, it wasn't.  I get the same error.  Any more ideas?

----------

## WhimpyPeon

If you build PHP with both freetds and mssql you will get this error.  If you need mssql build without freetds.  I had this same problem and adding -freetds to my make.conf fixed the problem.

----------

## swingarm

 *WhimpyPeon wrote:*   

> If you build PHP with both freetds and mssql you will get this error.  If you need mssql build without freetds.  I had this same problem and adding -freetds to my make.conf fixed the problem.

 

Arggg, didn't work.   It did work for little while after the intial installation then it got this error so I think I originally compilied it correclty.  Thanks for the info though.

----------

## WhimpyPeon

 *Quote:*   

> duplicate name - mssql_connect

 

This message is saying that there are two things that are providing the mssql_connect function.  If you trim out any database functions that you don't need you should be able to rid yourself of this problem.  Check your phpinfo.php (if you have one) and make sure that php was built:

--without-sybase

(clearing freetds should do that).

If you build --with-sybase they both provide these functions and they conflict.

----------

## WhimpyPeon

Another silly question... do you even use Microsoft SQL Server?  If you are just connecting to MySQL then you don't even need mssql.  If that is the case add:

-mssql -freetds 

to your /etc/make.conf and these problems should go away.

----------

## swingarm

Well I'm getting a little closer, now the error is only one line:

```

[Fri Sep 16 16:42:22 2005] [alert] mod_unique_id: unable to gethostbyname("hopecentre2")

```

----------

## swingarm

bump

Soooo close.

----------

## kashani

make sure your hostname and domain is correct in /etc/hosts and /etc/hostname and /etc/dnsdomainname

kashani

----------

## swingarm

Cool, that got it working.  Thank you everybody.

----------

## point3

What if I need that MSSQL support?

I'm getting the same error.

----------

