Library für apache wird beim booten nicht gefunden

Hallo,
ich habe ein (vielleicht einfaches) Problem. Nach der Installation
von php5 exestiert in der httpd.conf ein Eintrag:
Code:
LoadModule php5_module              libexec/apache22/libphp5.so
Beim booten kommt jetzt der Fehler:
Code:
Starting apache22.
httpd: Syntax error on line 104 of /etc/apache22/httpd.conf: 

Cannot load /usr/local/libexec/apache22/libphp5.so into server: 
Shared object "libiconv.so.3" not found, required by "libxml2.so.5"

ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout
Local ldconfig path: /usr/local/libdata/ldconfig/mysql

Interessanter Weise kann ich den Webserver per Hand ohne Probleme starten
mit >apachectl start.

HTML-Datei mit phpinfo() läßt sich via WebClient abfragen.
libxml2.so.5, libiconv.so.3 sind in /usr/local/lib vorhanden.

libxml2.so.5, libiconv.so.3 sind in /usr/local/lib und,
libphp5.so ist in vorhanden.

in libphp5.la steht:
Code:
# Libraries that this one depends upon.
dependency_libs=' -lcrypt -lcrypt -lm -lm -lcrypt -lcrypt 
                              -L/usr/local/lib -lcrypt -lcrypt -lm /usr/local/lib/libxml2.la 
                               -lm -lz -liconv -lm -lcrypt -lcrypt'
passt also. PHP5 deinstalliert und nochmal installiert - keine Änderung.

Warum gibt es diesen Fehler nur beim booten? Nach was muß ich suchen?

Herzlichen Dank!
Harald
 
Zuletzt bearbeitet:
vieleicht noch interessant:

LD_LIBRARY_PATH=/usr/lib:usr/local/lib
LIBDIR=/usr/lib:usr/local/lib

ein
>ldconfig -m /usr/local/lib/

habe ich auch schon probiert.
 
HaraldLangner schrieb:
Hallo,
ich habe ein (vielleicht einfaches) Problem. Nach der Installation
von php5 exestiert in der httpd.conf ein Eintrag:
Code:
LoadModule php5_module              libexec/apache22/libphp5.so
Beim booten kommt jetzt der Fehler:
Code:
Starting apache22.
httpd: Syntax error on line 104 of /etc/apache22/httpd.conf: 

Cannot load /usr/local/libexec/apache22/libphp5.so into server: 
Shared object "libiconv.so.3" not found, required by "libxml2.so.5"

ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout
Local ldconfig path: /usr/local/libdata/ldconfig/mysql

Interessanter Weise kann ich den Webserver per Hand ohne Probleme starten
mit >apachectl start.

HTML-Datei mit phpinfo() läßt sich via WebClient abfragen.
libxml2.so.5, libiconv.so.3 sind in /usr/local/lib vorhanden.

libxml2.so.5, libiconv.so.3 sind in /usr/local/lib und,
libphp5.so ist in vorhanden.

in libphp5.la steht:
Code:
# Libraries that this one depends upon.
dependency_libs=' -lcrypt -lcrypt -lm -lm -lcrypt -lcrypt -L/usr/local/lib -lcrypt -lcrypt -lm /usr/local/lib/libxml2.la -lm -lz -liconv -lm -lcrypt -lcrypt'
passt also. PHP5 deinstalliert und nochmal installiert - keine Änderung.

Warum gibt es diesen Fehler nur beim booten? Nach was muß ich suchen?

Herzlichen Dank!
Harald
Was ist denn das für ein OS? Das ist so ein typischer Fehler für einen falschen LD_LIBRARY_PATH. Beim Login wird der bei dir scheinbar gesetzt und dann klappt das auch mit dem Indianer. Stoppe den mal und mache ein 'unset LD_LIBRARY_PATH' und dann sollte er auch die Meldung bringen. Wenn das so ist, solltest du den Pfad setzen, z.B. im Startscript. Bei der Verwendung von ports/pkgsrc sollte das aber eigentlich nicht nötig sein.

Gruß c.
 
Hallo,
danke für Deine Antwort.
Ich habe unset LD_LIBRARY_PATH gemacht und kann den apache
mit "apachectl start" trotzdem starten. Nur beim Booten ist das Problem.

Bsys: freeBSD 6.0

">/etc/rc.d/apache22 start" was wohl beim booten aufgerufen wird geht auch.

Gruß - HL
 
HaraldLangner schrieb:
Hallo,
danke für Deine Antwort.
Ich habe unset LD_LIBRARY_PATH gemacht und kann den apache
mit "apachectl start" trotzdem starten. Nur beim Booten ist das Problem.

Bsys: freeBSD 6.0

">/etc/rc.d/apache22 start" was wohl beim booten aufgerufen wird geht auch.

Gruß - HL
Wenn du FBSD nutzt, dann bin ich auch überfragt.

Bei den Ports von FreeBSD u. OpenBSD sowie pkgsrc unter NetBSD ist mir soetwas noch nie passiert, das ich am LD_LIBRARY_PATH bzw. LD_RUN_PATH fummeln mußte. Nur bei pkgsrc unter Solaris 2.7-2.9 oder beim händischen Bauen unter Solaris. Notfalls ports nochmal aktualisieren und den Indianer mit seinen Abhängigkeiten neu bauen lassen.

Gruß c.
 
Nun ich denke das ist auch kein Problem mit den Ports oder mit
LD_LIBRARY_PATH. Aber beim booten findet er die Library's nicht oder ich verstehe den Fehler nicht:
Code:
Cannot load /usr/local/libexec/apache22/libphp5.so into server: 
Shared object "libiconv.so.3" not found, required by "libxml2.so.5"
Die Dateien sind doch alle da, warum findet apache sie beim booten nicht?
 
Koenntest Du bitte mal die /etc/rc.d/apache22 posten? Mir kommt der Output Deines Originalposts etwas spanisch vor, weil da der Apache vorm ldconfig kommt. Was bedeuten wuerde, dass er garnicht wirklich weiss, wo er suchen soll.
 
Ja, kann ich - danke für Dein Interesse.

Code:
#!/bin/sh
#
# $FreeBSD: ports/www/apache22/files/apache.sh,v 1.14 2006/02/20 20:47:47 dougb Exp $
#

# PROVIDE: apache22
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable apache22:
# apache22_enable (bool):      Set to "NO" by default.
#                             Set it to "YES" to enable apache22
# apache22_profiles (str):     Set to "" by default.
#                              Define your profiles here.
# apache22limits_enable (bool):Set to "NO" by default.
#                             Set it to yes to run `limits $limits_args`
#                             just before apache starts.
# apache22_flags (str):        Set to "" by default.
#                             Extra flags passed to start command.
# apache22limits_args (str):   Default to "-e -C daemon"
#                             Arguments of pre-start limits run.
# apache22_http_accept_enable (bool): Set to "NO" by default.
#                             Set to yes to check for accf_http kernel
#                             module on start up and load if not loaded.
. /etc/rc.subr

name="apache22"
rcvar=`set_rcvar`

start_precmd="apache22_precmd"
restart_precmd="apache22_checkconfig"
reload_precmd="apache22_checkconfig"
reload_cmd="apache22_graceful"
graceful_cmd="apache22_graceful"
gracefulstop_cmd="apache22_gracefulstop"
configtest_cmd="apache22_checkconfig"
command="/usr/local/sbin/httpd"
_pidprefix="/var/run/httpd"
pidfile="${_pidprefix}.pid"
required_files=/etc/apache22/httpd.conf

[ -z "$apache22_enable" ]       && apache22_enable="NO"
[ -z "$apache22_profiles" ]     && apache22_profiles=""
[ -z "$apache22_flags" ]        && apache22_flags=""
[ -z "$apache22limits_enable" ] && apache22limits_enable="NO"
[ -z "$apache22limits_args" ]   && apache22limits_args="-e -C daemon"
[ -z "$apache22_http_accept_enable" ] && apache22_http_accept_enable="NO"

apache22_accf() {
	retcode=0
	if checkyesno apache22_http_accept_enable
	then
		/sbin/kldstat -v | grep accf_http 2>&1 > /dev/null
		retcode=${?}
		if [ ${retcode} -ne 0 ]
		then
			/sbin/kldload accf_http 2> /dev/null
			retcode=${?}
		fi
	else
		apache22_flags="${apache22_flags} -DNOHTTPACCEPT"
	fi
	[ ${retcode} -ne 0 ] && echo "Unable to load accf_http module"
	return ${retcode}
}

load_rc_config $name

if [ -n "$2" ]; then
	profile="$2"
	if [ "x${apache22_profiles}" != "x" ]; then
		pidfile="${_pidprefix}.${profile}.pid"
		eval apache22_configfile="\${apache22_${profile}_configfile:-}"
		if [ "x${apache22_configfile}" = "x" ]; then
			echo "You must define a configuration file (apache22_${profile}_configfile)"
			exit 1
		fi
		required_files="${apache22_configfile}"
		eval apache22_enable="\${apache22_${profile}_enable:-${apache22_enable}}"
		eval apache22_flags="\${apache22_${profile}_flags:-${apache22_flags}}"
		eval apache22_http_accept_enable="\${apache22_${profile}_http_accept_enable:-${apache22_http_accept_enable}}"
		eval apache22limits_enable="\${apache22limits_${profile}_enable:-${apache22limits_enable}}"
		eval apache22limits_args="\${apache22limits_${profile}_args:-${apache22limits_args}}"
		apache22_flags="-f ${apache22_configfile} -c \"PidFile ${pidfile}\" ${apache22_flags}"
	else
		echo "$0: extra argument ignored"
	fi
else
	if [ "x${apache22_profiles}" != "x" -a "x$1" != "x" ]; then
		if [ "x$1" != "xrestart" ]; then
			for profile in ${apache22_profiles}; do
				echo "===> apache22 profile: ${profile}"
				/etc/rc.d/apache22 $1 ${profile}
				retcode="$?"
				if [ "0${retcode}" -ne 0 ]; then
					failed="${profile} (${retcode}) ${failed:-}"
				else
					success="${profile} ${success:-}"
				fi
			done
			exit 0
		else
			restart_precmd=""
		fi
	fi
fi

if [ "${1}" != "stop" ] ; then \
	apache22_accf || apache22_flags="${apache22_flags} -DNOHTTPACCEPT"
fi

apache22_requirepidfile()
{
	if [ ! "0`check_pidfile ${pidfile} ${command}`" -gt 1 ]; then
		echo "${name} not running? (check $pidfile)."
		exit 1
	fi
}

apache22_checkconfig()
{
	echo "Performing sanity check on apache22 configuration:"
	eval ${command} ${apache22_flags} -t
}

apache22_graceful() {
	apache22_requirepidfile

	echo "Performing a graceful restart"
	eval ${command} ${apache22_flags} -k graceful
}

apache22_gracefulstop() {
	apache22_requirepidfile

	echo "Performing a graceful stop"
	eval ${command} ${apache22_flags} -k graceful-stop
}

apache22_precmd() 
{
	apache22_checkconfig

	if test -f /etc/apache22/envvars.d
	then
		. /etc/apache22/envvars.d
	fi

	if checkyesno apache22limits_enable
	then
		eval `/usr/bin/limits ${apache22limits_args}` 2>/dev/null
	else
		return 0
        fi

}

extra_commands="reload graceful gracefulstop configtest"
run_rc_command "$1"
Gruß - Harald
 
Zuletzt bearbeitet:
Lösungsansatz und deshalb neue Frage

k3rn3lpanic schrieb:
...Mir kommt der Output Deines Originalposts etwas spanisch vor, weil da der Apache vorm ldconfig kommt. Was bedeuten wuerde, dass er garnicht wirklich weiss, wo er suchen soll.

Stimmt daran hat es gelegen :) Ich habe in /etc/rc.d/apache22 so umbenannt
(lddapache22) so dass das Script hinter ldconfig aufgerufen wird ==> dann wird der apache auch beim booten ohne Fehler geladen.

Aber das ist sicher nicht der richtige Weg.

Weis jemand wie man in /etc/rc.d/ die Reihenfolge der Skripte bestimmt, bzw deren Abhängigkeiten untereinander definieren kann?

Grüsse - Harald
 
Ja - mit
Code:
rcorder /etc/rc.d/*
bekommst Du die Reihenfolge raus
und in dem jeweiligen Script die Einträge wie folgt ändern
Code:
# PROVIDE: apache22
# REQUIRE: NETWORKING SERVERS ldconfig ldconfig_compat
# BEFORE: DAEMON
# KEYWORD: shutdown
dann wird ldconfig vor apache22 ausgeführt.
 
Du hast wahrscheinlich beim Update kein mergemaster gemacht und apache22.sh wird deswegen zum falschen Zeitpunkt geladen.
 
Zurück
Oben