probleme beim statischen linken von php zu apache ! help !

Alles, was den Apache betrifft, kann hier besprochen werden.

probleme beim statischen linken von php zu apache ! help !

Postby linux.apache » 03. March 2003 12:38

Hidiho liebe ApacheFreunde,

wer hier öfters vorbeischaut, dürfte mitbekommen haben, daß ich Probleme hatte, überhaupt apache mit php zum Laufen zu bringen (naja, eigentlich lief ja alles, nur nicht so wie ich´s mir vorgestellt hatte ;-) ) Danke Seidler-->the problem went away ;-)
So. Jetzt versuche ich php statisch zu apache zu linken, und meine letzte hoffnung war die php-doku...ich habe mich an deren vorgabe gehalten, und noch einige andere switches gesetzt; das Problem ist, dass ich bei --activate-module den Pfad zur "php4-Moduldatei" angeben soll...in der doku wird beschrieben :
für PHP 3: ./configure --activate-module=src/modules/php3/libphp3.a
für PHP 4: ./configure --activate-module=src/modules/php4/libphp4.a
Es macht mir Angst, festzustellen, daß sich unter dem pfad "src/modules/php4/" mehrere lib*-dateien befinden, ABER KEINE LIBPHP4.A !!!
Dort gibt es :
libmodphp4.a Makefile.libdir mod_php4.c mod_php4.h mod_php4.o
libphp4.module Makefile.tmpl mod_php4.exp mod_php4.lo

So, die ganzen mod-teile hab ich mal vernachlässigt ;-) also bleibt nur noch libmodphp4 (was meiner meinung nach auch falsch ist) und libphp4.module (was sich gut anhört)....Leider komm ich nicht weit beim build, er bricht mit folgendem Kommentar ab :
Configuring for Apache, Version 1.3.27
+ using installation path layout: Apache (config.layout)
+ activated php4 module (modules/php4/libphp4.a)
Creating Makefile
Creating Configuration.apaci in src
+ enabling mod_so for DSO support
Creating Makefile in src
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ checking for system header files
+ adding selected modules
o rewrite_module uses ConfigStart/End
+ using -ldb1 for DBM support
enabling DBM support for mod_rewrite
o dbm_auth_module uses ConfigStart/End
o php4_module uses ConfigStart/End
+ using system Expat
+ using -ldl for vendor DSO support
+ checking sizeof various data types
+ doing sanity check on compiler and options
** A test compilation with your Makefile configuration
** failed. The below error output from the compilation
** test will give you an idea what is failing. Note that
** Apache requires an ANSI C Compiler, such as gcc.

======== Error Output for sanity check ========
cd ..; gcc -DLINUX=22 -I/usr/include/db1 `./apaci` -o helpers/dummy helpers/dummy.c -Wl,-rpath,/usr/lib/mysql -rdynamic -L/usr/lib/mysql -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 -export-symbols /usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym -rdynamic -L/usr/lib/mysql -lpanel -lncurses -lmysqlclient -lgmp -lgd -lgdbm -lcurl -lcrypt -ldmalloc -lresolv -lm -ldl -lnsl -lcrypt -lcurl -lssl -lcrypto -ldl -lm -lcrypt -ldb1 -lexpat -ldl
/usr/bin/ld:/usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym: file format not recognized; treating as linker script
/usr/bin/ld:/usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym:2: parse error
collect2: ld returned 1 exit status
make: *** [dummy] Error 1
============= End of Error Report =============
Aborting!

Ok, ich kann mir einiges denken, aber nix genaues weiss ich nicht; hängt es mit mysql zusammen ?? Welche Datei soll ich angeben, um php statisch mit apache zu kompilieren ? Ich meine, ich kann ja weiterraten, aber das hat mich jetzt erstmal von den Socken gehauen, daß das Beispiel von http://www.php.net/manual/de/install.apache.php nicht möglich ist, weil diese Datei (noch ?) garnet existiert ....
Praxis:Jeder kann´s, aber keiner weiß wie´s geht...
Theorie:Jeder weiß wie´s geht, aber keiner kann´s ...
Microsoft vereint Praxis und Theorie : Nix geht und keiner weiß warum ;-)
User avatar
linux.apache
 
Posts: 25
Joined: 27. February 2003 00:41
Location: Berlin-Kreuzberg

the problem went away

Postby linux.apache » 03. March 2003 13:45

linux.apache wrote:
für PHP 4: ./configure --activate-module=src/modules/php4/libphp4.a

Es macht mir Angst, festzustellen, daß sich unter dem pfad "src/modules/php4/" mehrere lib*-dateien befinden, ABER KEINE LIBPHP4.A !!!
Dort gibt es :
libmodphp4.a Makefile.libdir mod_php4.c mod_php4.h mod_php4.o
libphp4.module Makefile.tmpl mod_php4.exp mod_php4.lo

Ich meine, ich kann ja weiterraten, aber das hat mich jetzt erstmal von den Socken gehauen, daß das Beispiel von http://www.php.net/manual/de/install.apache.php nicht möglich ist, weil diese Datei (noch ?) garnet existiert ....


Ok, alles klar, ich glaube, ich habe die Lösung "erraten" :-)
Die Lösung lautet : für PHP 4: ./configure --activate-module=src/modules/php4/libphp4.a !!
Und das, obwohl die Datei noch garnicht existiert, weil die ensteht nämlich währrend des Kompilierens durch "cp libmodphp4.a libphp4.a" ! Ich konnte es kaum glauben, aber ich habe es mit eigenen Augen gesehen ;-)

MIT STOLZER BRUST DARF ICH EUCH DIES ZEIGEN :
[root@redhat bin]# ./httpd -l
Compiled-in modules:
http_core.c
mod_env.c
mod_log_config.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_include.c

mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_access.c
mod_auth.c
mod_setenvif.c
mod_php4.c
suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec

So, jetzt teste ich mal die "neue KillerPerformance" von php ....
Praxis:Jeder kann´s, aber keiner weiß wie´s geht...
Theorie:Jeder weiß wie´s geht, aber keiner kann´s ...
Microsoft vereint Praxis und Theorie : Nix geht und keiner weiß warum ;-)
User avatar
linux.apache
 
Posts: 25
Joined: 27. February 2003 00:41
Location: Berlin-Kreuzberg

hoppla, zu früh gefreut :-(

Postby linux.apache » 03. March 2003 14:41

Also, wenn man sich zu 100% an die php-doku hält, dann klappt´s mit dem statischen Linken von PHP...leider will ich von apache n bissel mehr, als nur "--prefix" und "--activate-module"...sobald ich ein paar switches mehr setzte, muckt apache rum .... kann mir "jemand" einen Tip geben ? Anbei meine ./configure-Schritte und n bissel output ... (apache 1.3.27 + PHP 4.3.0 on redhat 8)

tar -xzvf /root/tarballz/apache_1.3.27.tar.gz (enter)
tar -xzvf /root/tarballz/php-4.3.0.tar.gz (enter)

cd apache_1.3.27 (enter)
./configure --prefix=/usr/local/lamp/apache (enter)

cd ../php-4.3.0 (enter)
./configure --prefix=/usr/local/lamp/php4 \
--with-apache=../apache_1.3.27 \
--with-mysql=/usr \
--with-ncurses \
--enable-safe-mode \
--disable-ipv6 \
--enable-bcmath \
--with-curl=/usr \
--with-gdbm=/usr \
--enable-ftp \
--with-gd=/usr \
--with-gettext \
--with-gmp \
--enable-mime-magic \
--enable-sysvshm \
--enable-versioning \
--enable-track-vars (enter)

make && make install (enter)
(php4 erfolgreich installiert)

cd ../apache_1.3.27 (enter)
./configure --prefix=/usr/local/lamp/apache \
--enable-module=most \
--enable-shared=max \
--activate-module=src/modules/php4/libphp4.a (die, die es eigentlich nicht gibt ;-) )
--disable-shared=php4 [egal ob mit oder ohne, funzt net :-( ] (enter)

So, output :
Configuring for Apache, Version 1.3.27
+ using installation path layout: Apache (config.layout)
+ activated php4 module (modules/php4/libphp4.a)
Creating Makefile
Creating Configuration.apaci in src
+ enabling mod_so for DSO support
Creating Makefile in src
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ checking for system header files
+ adding selected modules
o rewrite_module uses ConfigStart/End
+ using -ldb1 for DBM support
enabling DBM support for mod_rewrite
o dbm_auth_module uses ConfigStart/End
o php4_module uses ConfigStart/End
+ using system Expat
+ using -ldl for vendor DSO support
+ checking sizeof various data types
+ doing sanity check on compiler and options
** A test compilation with your Makefile configuration
** failed. The below error output from the compilation
** test will give you an idea what is failing. Note that
** Apache requires an ANSI C Compiler, such as gcc.

======== Error Output for sanity check ========
cd ..; gcc -DLINUX=22 -I/usr/include/db1 `./apaci` -o helpers/dummy helpers/dummy.c -Wl,-rpath,/usr/lib/mysql -rdynamic -L/usr/lib/mysql -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 -export-symbols /usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym -rdynamic -L/usr/lib/mysql -lpanel -lncurses -lmysqlclient -lgmp -lgd -lgdbm -lcurl -lcrypt -lresolv -lm -ldl -lnsl -lcrypt -lcurl -lssl -lcrypto -ldl -lm -lcrypt -ldb1 -lexpat -ldl
/usr/bin/ld:/usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym: file format not recognized; treating as linker script
/usr/bin/ld:/usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym:2: parse error
collect2: ld returned 1 exit status
make: *** [dummy] Error 1
============= End of Error Report =============

Aborting!

So, what the heck is it ??? hat jemand ne Idee, an welchem configure-switch die Installation haaaaackt ? ich bin mir unsicher, vielleicht isses ja --enable-sysvshm oder so ? Wer was weiß, bitte posten !!! Ich fummel hier auch noch n bissel rum, aber wer was zu sagen hat, der soll sich keinen Zwang antun ;-)
Praxis:Jeder kann´s, aber keiner weiß wie´s geht...
Theorie:Jeder weiß wie´s geht, aber keiner kann´s ...
Microsoft vereint Praxis und Theorie : Nix geht und keiner weiß warum ;-)
User avatar
linux.apache
 
Posts: 25
Joined: 27. February 2003 00:41
Location: Berlin-Kreuzberg

Weniger ist oft mehr ...

Postby linux.apache » 03. March 2003 16:47

Also, ich bin zurück, um meine Selbstgespräche weiterzuführen ;-)

Ich habe mein Ziel erreicht :

[root@redhat apache_1.3.27]# /usr/local/lamp/apache/bin/httpd -l
Compiled-in modules:
http_core.c
mod_so.c
mod_php4.c
suexec: disabled; invalid wrapper /usr/local/lamp/apache/bin/suexec

Aber bei dem ganzen "verzeichnis-hin- und her-geswitche" kann man ja auch mal den Überblick verlieren ... Die Lösung des Problemes war eine "vernünftige" ./configure-line für apache : (nachdem php4 installiert wurde)

./configure --prefix=/usr/local/lamp/apache \
--enable-module=most \
--enable-shared=max \
--activate-module=src/modules/php4/libphp4.a (schon wieder diese blöde Datei ;-) ) (enter)

Schön, dass ma auch mit Selbstgesprächen und Selbstreflektion so weit kommen kann ;-)
Praxis:Jeder kann´s, aber keiner weiß wie´s geht...
Theorie:Jeder weiß wie´s geht, aber keiner kann´s ...
Microsoft vereint Praxis und Theorie : Nix geht und keiner weiß warum ;-)
User avatar
linux.apache
 
Posts: 25
Joined: 27. February 2003 00:41
Location: Berlin-Kreuzberg

Postby Oswald » 03. March 2003 18:27

Hi linux.apache!

Ja, wirklich klasse. Herzlichen Glückwunsch! ;) Ich hätte heut abend erst wieder Zeit gehabt mir Dein Problem genauer anzuschauen. Aber so ist's natürlich noch besser.

Liebe Grüße,
Oswald ;)
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Wie wär´s mit nem spannenden Krimi ?

Postby linux.apache » 03. March 2003 18:50

Kai Seidler wrote: Ich hätte heut abend erst wieder Zeit gehabt mir Dein Problem genauer anzuschauen.


Gut, dann habe ich noch etwas Abendlektüre extra für Dich ;-)
PHP statisch zu apache zu linken klappt (anscheinend) "bei mir" nur mit ganz minimalen configure-optionen ... kaum gebe ich ein bissel mehr ein, heult apache rum, dass er auf die "php.sym" net klarkommt...

Was ich getan habe ?
tartartar ;-)
cd apache_source
./configure --prefix=/usr/local/lamp/apache

cd ../php_source
./configure --prefix=/usr/local/lamp/php4 --with-apache=../apache_1.3.27 --with-mysql=/usr --enable-safe-mode --enable-dmalloc --disable-ipv6 --enable-bcmath --with-gdbm=/usr --enable-ftp --enable-versioning --enable-track-vars --with-ncurses --enable-mime-magic
(vermerk : configure hatte kein problem !)
make && make install
(vermerk : make hatte kein problem !)

cd ../apache_source
./configure --prefix=/usr/local/lamp/apache --enable-module=most --enable-shared=max --activate-module=src/modules/php4/libphp4.a

Eigentlich genau das gleiche, wie ich´s vorhin schon mal geschafft habe, mit dem Unterschied, dass ich jetzte mal n bissel mehr von PHP abverlange ;-)

Was Apache davon hält ? Nicht viel :-(

Configuring for Apache, Version 1.3.27
+ using installation path layout: Apache (config.layout)
+ activated php4 module (modules/php4/libphp4.a)
Creating Makefile
Creating Configuration.apaci in src
+ enabling mod_so for DSO support
Creating Makefile in src
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ checking for system header files
+ adding selected modules
o rewrite_module uses ConfigStart/End
+ using -ldb1 for DBM support
enabling DBM support for mod_rewrite
o dbm_auth_module uses ConfigStart/End
o php4_module uses ConfigStart/End
+ using system Expat
+ using -ldl for vendor DSO support
+ checking sizeof various data types
+ doing sanity check on compiler and options
** A test compilation with your Makefile configuration
** failed. The below error output from the compilation
** test will give you an idea what is failing. Note that
** Apache requires an ANSI C Compiler, such as gcc.

======== Error Output for sanity check ========
cd ..; gcc -DLINUX=22 -I/usr/include/db1 `./apaci` -o helpers/dummy helpers/dummy.c -Wl,-rpath,/usr/lib/mysql -rdynamic -L/usr/lib/mysql -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 -export-symbols /usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym -rdynamic -L/usr/lib/mysql -lpanel -lncurses -lmysqlclient -lz -lgdbm -lcrypt -ldmalloc -lresolv -lm -ldl -lnsl -lcrypt
-lm -lcrypt -ldb1 -lexpat -ldl
/usr/bin/ld:/usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym: file format not recognized; treating as linker script
/usr/bin/ld:/usr/local/src/lamp/php-4.3.0/sapi/apache/php.sym:2: parse error
collect2: ld returned 1 exit status
make: *** [dummy] Error 1
============= End of Error Report =============
Aborting!

So; leider hab ich kein Plan und Null Verständnis, wieso er hier über die php.sym meckert und ein paar Installationsversuche früher damit kein problem hatte. Meine Vermutung : Entweder ich hätte mysql nicht per rpm installieren sollen :oops: oder aber eines der vielen features von php mit seinen "bundled extensions" kommt mit meinen Ansprüchen nicht zurecht ;-)

Ich schau zu später Stund´ nochmal rein, vielleicht kennste dieses Problem ja schon ...

P.S.:Bitte mir nicht übel nehmen, daß ich so ein "error-message-spammer" bin :roll:
Praxis:Jeder kann´s, aber keiner weiß wie´s geht...
Theorie:Jeder weiß wie´s geht, aber keiner kann´s ...
Microsoft vereint Praxis und Theorie : Nix geht und keiner weiß warum ;-)
User avatar
linux.apache
 
Posts: 25
Joined: 27. February 2003 00:41
Location: Berlin-Kreuzberg

Ok, Problem scheint "gelöst" zu sein !?!

Postby linux.apache » 04. March 2003 11:48

Also, ich habe die "zuerst-wenig,dann-mehr"-Vorgehensweise gewählt, um herauszufinden, an welcher ./configure-line sich apache bei der statischen Einbindung von php aufhängt....
Meine tollen Fehlermeldungen haben es ja eigentlich gesagt : something like : "could not resolve symbol names" ....
Tja, und von den vielen Optionen, die ich verwendet habe, ist "--enable-versioning" der Übeltäter, weil dieser switch nur die benötigten Symbole exportiert ... Anscheinend haben ich und mein PHP verschiedene Ansichten darüber, welche Symbole exportiert werden sollen, und welche nicht :wink:
Ok, ich fummel hier jetzt noch n bissel weiter rum (ssl würde meinem apache auch gut gefallen) und werde in Zukunft einfach dieses "--enable-versioning" weglassen ... keine wirkliche Lösung, aber zumindest ein Schritt nach vorne ...
Praxis:Jeder kann´s, aber keiner weiß wie´s geht...
Theorie:Jeder weiß wie´s geht, aber keiner kann´s ...
Microsoft vereint Praxis und Theorie : Nix geht und keiner weiß warum ;-)
User avatar
linux.apache
 
Posts: 25
Joined: 27. February 2003 00:41
Location: Berlin-Kreuzberg


Return to Apache

Who is online

Users browsing this forum: No registered users and 24 guests