howto für suse 9.0 + php-cgi und suphp?

Apache, Lighttpd, nginx, Cherokee
Post Reply
tobiask
Posts: 164
Joined: 2004-05-02 12:08
Location: NRW
Contact:
 

howto für suse 9.0 + php-cgi und suphp?

Post by tobiask »

hi,

wir müssen auf php-cgi umrüsten da mod_php nicht mit visas bei strato läuft, nur bekomm ich das irgendweier net hin, hab nen paar debian tuts dazu gelesen
aber es läuft einfach nicht ...

kann mir jemand dazu eine schritt-für-schritt anleitung posten oder mir dabei helfen das hinzubekokmen?
projekt2501
Posts: 92
Joined: 2003-08-14 08:23
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by projekt2501 »

Hi,

das ist eigentlich gar nicht soooooo schwer, wenn man ein paar Hürden kennt.

1) prüf mal nach welche uid der Apache User (vmtl. wwwrun) hat. Das geht in YaST. Bei mir war es 30. Minimum uid ist standardmäßig 100 bei suPHP.

2) Wenn die uid kleiner ist mußt du suPHP mit entsprechender Option konfigurieren. Wie man das macht steht in den Doks von suPHP

3) mach mal ein php -v Wenn da was von CGI steht ist alles OK. Wenn da aber CLI steht mußt du erst nochmal php kompilieren, oder das entsprechende CGI Binary beim Kompilieren von suPHP angeben. Auch wie das geht steht in den Docs.

Hoffe ich konnte damit etwas helfen.
Wenn nicht einfach nochmal fragen.
tobiask
Posts: 164
Joined: 2004-05-02 12:08
Location: NRW
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by tobiask »

danke erstma, das hilft schon was, also suPHP lässt sich net inst. kommt immer:

Code: Select all

make[1]: Entering directory `/usr/src/suphp/suphp-0.5.2/src'
*** WARNING: No 'apxs' found. Skipping mod_suphp! ***
/usr/bin/install -c -d /usr/sbin
/usr/bin/install -c -m 4755 suphp /usr/sbin/suphp
*** WARNING: No 'apxs' found. Skipping installation of mod_suphp! ***
make[1]: Leaving directory `/usr/src/suphp/suphp-0.5.2/src'
und wie genau muss ich den php pfad angeben?
hab das cgi teil in /etc/php-4.3.10 reingepackt
da kommt bei php -v auch das:

Code: Select all

h55004:/etc/php4.3.10/bin # ./php -v
PHP 4.3.10 (cgi-fcgi) (built: Feb  8 2005 18:40:07)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
wie kann ich suPHP denoch installieren jetzt?

p.s.: uid liegt bei 10** beim apache ...
projekt2501
Posts: 92
Joined: 2003-08-14 08:23
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by projekt2501 »

poste mal dein ./configure
und ich habe Zweifel daran, dass suPHP mit der fcgi sprich fastCGI version von PHP zusammenarbeitet. Sicher bin ich mir jedoch nicht. also php mal ohne --enable-fastcgi kompilieren.
projekt2501
Posts: 92
Joined: 2003-08-14 08:23
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by projekt2501 »

und gib den pfad zu apxs bzw. apxs2 an sollte in /usr/sbin oder /usr/bin zu finden sein.
gleitz
Posts: 44
Joined: 2004-01-26 21:48
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by gleitz »

Wenn der Apache2 mit SuSE RPM installiert worden ist, dann befindet sich die apxs in einem anderen Verzeichnis, als es beim compilen von php gesucht wird. Sym. Link erstellen.

"Oder besser gleich Apache2 RPM runter werfen und mit den aktuellen Sourcen selber kompielen"
tobiask
Posts: 164
Joined: 2004-05-02 12:08
Location: NRW
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by tobiask »

Projekt2501 wrote:poste mal dein ./configure
und ich habe Zweifel daran, dass suPHP mit der fcgi sprich fastCGI version von PHP zusammenarbeitet. Sicher bin ich mir jedoch nicht. also php mal ohne --enable-fastcgi kompilieren.
sieht so aus:

Code: Select all

./configure --prefix=/usr --disable-checkpath --with-min-uid=100 --with-min-gid=100 --with-apache-user=www --with-php=/usr/src/php4-src/php-4.3.10 --with-apxs=/usr/sbin/apxs2
aber kommt jetzt immer:

Code: Select all

apxs:Error: Config file /etc/apache2/httpd2-prefork.conf not found.
make[2]: *** [install] Error 1
make[2]: Leaving directory `/usr/src/suphp/suphp-0.5.2/src/apache2'
make[1]: Leaving directory `/usr/src/suphp/suphp-0.5.2/src'
warum findet er das nun wieder nicht?
apache2 wurde übrigens mit suse rpm inst.

wegen dem fastcgi, hab in dem tut für debian was rumgegugt, da isses auch mit fcgi und suphp, siehe -> http://www.debianhowto.de/howtos/de/apa ... sarge.html
projekt2501
Posts: 92
Joined: 2003-08-14 08:23
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by projekt2501 »

zum ./configure:

schau mal nach, ob der apache nicht viel eher als www-run läuft.
--with-php muß auf das fertig kompilierte binary von php zeigen
wieso --disable-checkpath?

zum Fehler:
Den Fehler hatte ich auch: von hand eintragen, dass das modul geladen wird... dann in die vhost datei noch die folgenden zeilen rein:

Code: Select all

suPHP_Engine on
php_admin_flag engine off
AddType application/x-httpd-php .php
AddHandler x-httpd-php .php
und schwups funzt der apache2 mit suphp :)
suntzu
Posts: 669
Joined: 2002-12-20 19:47
Location: Mönchengladbach
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by suntzu »

Projekt2501 wrote:poste mal dein ./configure
und ich habe Zweifel daran, dass suPHP mit der fcgi sprich fastCGI version von PHP zusammenarbeitet. Sicher bin ich mir jedoch nicht. also php mal ohne --enable-fastcgi kompilieren.
Doch, geht. Läuft zumindest hier (Debian Stable + diverse Backports) stabil.
projekt2501
Posts: 92
Joined: 2003-08-14 08:23
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by projekt2501 »

gut zu wissen, danke!
tobiask
Posts: 164
Joined: 2004-05-02 12:08
Location: NRW
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by tobiask »

jetzt nutze ich:

Code: Select all

./configure --prefix=/usr --with-min-uid=100 --with-min-gid=100 --with-apache-user=www-run --with-php=/etc/php4.3.10 --with-apxs=/usr/sbin/apxs2
aber mit der selben fehlermeldung wie oben!
also das er die httpd2-prefork... net findet...

edit:
hab grad gesehn das in der httpd.visas ´drinsteht das der apache user vpopmail is !?

Code: Select all

# run under this user/group id
User vpopmail
Group visas
der muss dann doch als apache user angegeben werden, oder?

edit2: und wo trage ich das modul ein, sodas se s geladen wird?
das viosas überschreibt mir das wenn ich das in die loadmodule.conf beim /etc/apache2/sysconfig.d schreibe ...
projekt2501
Posts: 92
Joined: 2003-08-14 08:23
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by projekt2501 »

Tobiask wrote:jetzt nutze ich:

Code: Select all

./configure --prefix=/usr --with-min-uid=100 --with-min-gid=100 --with-apache-user=www-run --with-php=/etc/php4.3.10 --with-apxs=/usr/sbin/apxs2
aber mit der selben fehlermeldung wie oben!
also das er die httpd2-prefork... net findet...

edit:
hab grad gesehn das in der httpd.visas ´drinsteht das der apache user vpopmail is !?

Code: Select all

# run under this user/group id
User vpopmail
Group visas
der muss dann doch als apache user angegeben werden, oder?
ja

Tobiask wrote: edit2: und wo trage ich das modul ein, sodas se s geladen wird?
das viosas überschreibt mir das wenn ich das in die loadmodule.conf beim /etc/apache2/sysconfig.d schreibe ...
weiß nicht so genau, durchforste mal alle dateien die included werden von der httpd.conf. Mit Visas kenn ich mich nicht aus.
tobiask
Posts: 164
Joined: 2004-05-02 12:08
Location: NRW
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by tobiask »

aber der apxs fehler bleibt ja leider ...
wie bekomm ich den weg?
projekt2501
Posts: 92
Joined: 2003-08-14 08:23
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by projekt2501 »

Tobiask wrote:aber der apxs fehler bleibt ja leider ...
wie bekomm ich den weg?
*g* ich hab mich darum nicht weiter gekümmert. der will da nur das module laden eintragen soweit ich weiß. Das machste wie oben schon geschrieben manuell, dann gehts. Sprich ignorier den Fehler.
tobiask
Posts: 164
Joined: 2004-05-02 12:08
Location: NRW
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by tobiask »

Projekt2501 wrote:
Tobiask wrote:aber der apxs fehler bleibt ja leider ...
wie bekomm ich den weg?
*g* ich hab mich darum nicht weiter gekümmert. der will da nur das module laden eintragen soweit ich weiß. Das machste wie oben schon geschrieben manuell, dann gehts. Sprich ignorier den Fehler.
aso, okay ;)
werd ich ma gugn obs klappt!
tobiask
Posts: 164
Joined: 2004-05-02 12:08
Location: NRW
Contact:
 

Re: howto für suse 9.0 + php-cgi und suphp?

Post by tobiask »

Projekt2501 wrote:
Tobiask wrote:aber der apxs fehler bleibt ja leider ...
wie bekomm ich den weg?
*g* ich hab mich darum nicht weiter gekümmert. der will da nur das module laden eintragen soweit ich weiß. Das machste wie oben schon geschrieben manuell, dann gehts. Sprich ignorier den Fehler.
hm, also jetzt gehts irgendwie so:

Code: Select all

h55004:/etc/apache2/sysconfig.d # apache2ctl restart
Syntax error on line 237 of /etc/apache2/httpd.conf:
Invalid command 'suPHP_Engine', perhaps mis-spelled or defined by a module not included in the server configuration
h55004:/etc/apache2/sysconfig.d # suphp
Error in suphp.c on line 210: SCRIPT_FILENAME is not set
h55004:/etc/apache2/sysconfig.d #
also wenn man den apache neustratet meckert er rum ...
hab das teil aber in /etc/sysconfig/apache2 eingetragen, also suphp
und wenn man wie oben suphp so aufruft kommt auch nen fehler ...
hm, langsam wirds nervig ^^
weißt noch weiter?
Post Reply