PHP5 als Fcgi

Apache, Lighttpd, nginx, Cherokee
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

r00ty wrote:hmm, also ich bin ja gerne Bereit zu helfen - aber ein wenig Eigeninitiative wäre auch nett...
z.B. solltest du jetzt erstmal den Fehler beim Apache restart beheben...

und zudem hast du's wieder nicht so gemacht wie ich gesagt habe - dein Action sieht anders aus
Sorry, nicht zu ende geschrieben. war ja auch Action php5-script "/cgi-bin/php5/php"

Wie kann ich Apache restart Fehler beheben?

danke
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Also Eigeninitiative:

Habe Ordner cgi-bin in cgibin umbenannt dem entsprechend vhost.cong Eintrag editiert

Kein Fehler mehr bei apache restart
Beim Aufruf error 403 Forbidden

In error_log folgendes:

[Mon Apr 10 16:55:22 2006] [error] [client xx.xxx.xxx.xx] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /var/www/vhosts/meindomain.tld/httpdocs/cgibin/php5/php/cgibin
Last edited by test022 on 2006-04-10 18:46, edited 1 time in total.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: PHP5 als Fcgi

Post by Joe User »

Sollen wir Dir jetzt jede Fehlermeldung einzeln übersetzen und erläutern?

/me: kurz vor ~/unerwünscht...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Ne das nicht nur verstehe jetzt gar nicht....

1. RewriteRule ist bei mir aktiviert!
Meldung zeigt an dass es deaktiviert ist...

ist es vielleicht wegen .htacces der in rootverzeichnis des Users liegt?

#AddType php5-cgi .php

# $Author: zx $
# $Date: 2003/08/17 14:03:21 $

# deny most common except .php
<FilesMatch ".(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module)$">
deny from all
</FilesMatch>

<Limit GET PUT POST>
Order Allow,Deny
Allow from all
</Limit>
Options +SymLinksIfOwnerMatch

RewriteEngine on
PHP_FLAG output_buffering on


Ich weiss jetzt garnichts weiter, habe totalen Blackout...
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

Code: Select all

Options +SymLinksIfOwnerMatch
rein (und schauen dass es nachher nicht wieder von was überschrieben wird

und mach erstmal deine .htaccess aus (umbennen)
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Also habe ich jetzt gemacht.

trotztdem:
[Mon Apr 10 18:40:53 2006] [error] [client xx.xxx.xxx.xx] script not found or unable to stat: /var/www/vhosts/meinedomain.tld/httpdocs/cgibin/php5/php/cgibin
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

ich bitte mal wieder um die aktuelle Config des Apachen (wie immer nur den relevanten Teil)
und wo liegt das Script ?
wo liegt der Interpreter ?
was tippst du im Browser ein ?
was ist Fehlermeldung im
-error.log
-suexec.log
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Config des Apachen vhost.conf (nicht wie bei dir r00ty weill, wenn ich anstatt cgibin nen cgi-bin ordner einsetze kommt ein Error bei apache restart)

<Directory "/var/www/vhosts/meinedomain.tld/httpdocs/cgibin/php5/php">
Order allow,deny
allow from all
Options ExecCGI
AllowOverride None
</Directory>

ServerName meinedomain.tld
ServerAlias meinedomain.tld

DocumentRoot /var/www/vhosts/meinedomain.tld/httpdocs/
SuexecUserGroup meinftpowner psacln
ScriptAlias /cgibin/ /var/www/vhosts/meinedomain.tld/httpdocs/cgibin/
Action php5-script "/cgibin/php5/php"
AddHandler php5-script .php5


und wo liegt das Script ?
schon überal :-)
httpdocs/info2.php5
httpdocs/cgibin/info2.php5
httpdocs/cgibin/php5/info2.php5
httpdocs/cgibin/php5/php/info2.php5


wo liegt der Interpreter ?
habe PHP-Binary hirhin kopiert:
/var/www/vhosts/meinedomain.tld/httpdocs/cgibin/php5/php/

compiliert habe ich wie folgt (habe alles neu compiliert):
$ ./configure --enable-memory-limit --enable-force-cgi-redirect --enable-track-vars --with-pcre-regex --with-mysql --without-sqlite --without-mm --enable-fastcgi --prefix=/home/verwaltung/php5
$ make
$ make install

/home/verwaltung/php5/bin # ./php -v
PHP 5.1.2 (cgi-fcgi) (built: Apr 10 2006 20:04:03)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies



was tippst du im Browser ein ?
meinedomain.tld/info2.php5
meinedomain.tld/cgibin/info2.php5
meinedomain.tld/cgibin/php5/info2.php5
meinedomain.tld/cgibin/php5/php/info2.php5


was ist Fehlermeldung im

-suexec.log hier passiert nie was

bei error_log:

egal was ich im browser eintippe kommt immer dasselbe:
meinedomain.tld/info2.php5
meinedomain.tld/cgibin/info2.php5
meinedomain.tld/cgibin/php5/info2.php5
meinedomain.tld/cgibin/php5/php/info2.php5


[Mon Apr 10 20:47:19 2006] [error] [client xx.xxx.xxx.xxx] script not found or unable to stat: /var/www/vhosts/meinedomain.tld/httpdocs/cgibin/php5/php/cgibin
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

test022 wrote:wo liegt der Interpreter ?
habe PHP-Binary hirhin kopiert:
/var/www/vhosts/meinedomain.tld/httpdocs/cgibin/php5/php/

ist der letzte slash ein Tippfehler ?
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

ja ist tippfehler, php ist ein ordner :-)
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

und deinen Loglevel kannste auch mal auf debug hochstellen (Apache wie immer restarten)
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

php ist ein Ordner ?????
php5 sollte ein Ordner sein
php die Binärdatei
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

und versuch erstmal dein cgi-bin zum laufen zu bekommen
erstell die Datei hier (mit chmod +x ausführbar machen)
/var/www/vhosts/meinedomain.tld/httpdocs/cgibin/test.sc

Code: Select all

#!/bin/bash
echo "Content-type: text/html";
echo;
echo "<H1>Hello World</H1>";
und ruf das mal mit

Code: Select all

meinedomain.tld/cgibin/test.sc
auf
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

habe alles korigiert:
habe PHP-Binary hirhin kopiert:
/var/www/vhosts/meinedomain.tld/httpdocs/cgibin/php5


/var/www/vhosts/meinedomain.tld/httpdocs/cgibin/php5 # dir
total 8824
drwxr-xr-x 2 meinftpowner psacln 4096 Apr 10 21:19 .
drwxr-xr-x 3 meinftpowner psacln 4096 Apr 10 15:31 ..
-rwxr-xr-x 1 meinftpowner psacln 21 Apr 8 02:12 info.php
-rwxr-xr-x 1 meinftpowner psacln 21 Apr 10 01:25 info2.php5
-rwxr-xr-x 1 meinftpowner psacln 721 Apr 10 21:16 pear
-rwxr-xr-x 1 meinftpowner psacln 742 Apr 10 21:16 peardev
-rwxr-xr-x 1 meinftpowner psacln 739 Apr 10 21:16 pecl
-rwxr-xr-x 1 meinftpowner psacln 8975149 Apr 10 21:19 php
-rwxr-xr-x 1 meinftpowner psacln 1020 Apr 10 21:19 php-config
-rwxr-xr-x 1 meinftpowner psacln 4187 Apr 10 21:19 phpize

hxxxxxx:/var/www/vhosts/meinedomain.tld/httpdocs/cgibin/php5 # ./php -v
PHP 5.1.2 (cgi-fcgi) (built: Apr 10 2006 20:04:03)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

error_log meldung
[Mon Apr 10 21:25:28 2006] [error] [client xx.xxx.xxx.xxx] fopen: No such file or directory
[Mon Apr 10 21:25:28 2006] [error] [client xx.xxx.xxx.xxx] Premature end of script headers: php
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

suexec.log ?
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

suexec.log meldet gar nichts....

habe test.sc erstellt rechte auf 755
error_log:

[Mon Apr 10 21:35:25 2006] [error] [client xx.xxx.xxx.xxx] fopen: No such file or directory
[Mon Apr 10 21:35:25 2006] [error] [client xx.xxx.xxx.xxx] Premature end of script headers: test.sc
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

stell mal bitte deine Loglevel hoch und kontrolliere dann alle logfiles (access - error - ....)
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

r00ty bitte hilfe...

habe festgestellt dass mein suexec2 zerschossen oder falsch eingestellt ist.

habe in usr/sbin/suexec2 in suexec2org umbenannt, apache restartet und schon läuft mein php5

mit suexec hab ich selbst noch nichts gemacht...
soweit ich weiss soll das dazu dienen dass, cgi scripte nicht unter dem user des webservers ausgeführt werden, sondern unter dem user, dem die cgi-datei gehört die dann zur zeit läuft.

wie kann ich aber mein suexec2 richtig einstellen oder neu compilliren?

Vielen Dank im voraus
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

naja, suexec Dienst dazu dass es mit den Rechten des suexecusergroup ausgeführt wird - ist ja auch sinnvoll
all right - wie bist du draufgekommen dass es an suexec liegt (und warum in aller welt funktioniert es wenn du es umbenennst ?!?)
sorry - ich blicks jetzt auch nicht mehr wirklich - hoffentlich schaut mal kurz einer der Admins mal wieder rein :-)
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: PHP5 als Fcgi

Post by Joe User »

Sein suexec wurde mit einem anderen Docroot, als dem aktuell genutztem, kompiliert und verweigert entsprechend die Arbeit. Warum das suexec_log nicht gefüllt wird, ist eine andere Frage ;)
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

ich beschäftige mich schon seit 01.03.2006 mit php5 compilation, habe schon bestimmt 1000 von HowTos durchstudiert.
Sogar Bücher zugelegt "jetzt lerne ich Apache2 von Hagen Graf"

Und überall wird leider nur kurz über suexec erwähnt. Logs files meldeten keine hilfreichen Fehler.

r00ty wir haben gemeinsam mein httpd.conf überarbeitet. Es ging aber trotzdem nicht. hier dachte ich es kann einfach nicht sein....

Dann kam ich auf die Idee einfach suexec2 zu Umbenennen

Aber wie korrigiere ich jetzt mein suexec2 oder wie compilire ich es richtig neu?

Was suexec.log angeht weiß ich leider auch nicht...

Und noch etwas obwohl php5 läuft bekomme ich Fehlermeldungen in error_log:
[Tue Apr 11 03:36:41 2006] [warn] Cannot get media type from 'php5-cgi'

woran kann es liegen?
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

so, jetzt wollen wir mal schauen was joe da meint:
Als root (zumindest bei SuSE)

Code: Select all

apache2ctl -V
und starte endlich mal deinen apache im Debug-Modus, vielleicht gibts da noch ein paar Hinweise.
Und hast du den Apachen selber kompiliert ?
wie sind die Rechte vom suexec.log ?
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

apache2ctl -V
Server version: Apache/2.0.53
Server built: Sep 2 2005 19:52:23
Server's Module Magic Number: 20020903:9
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/srv/www"
-D SUEXEC_BIN="/usr/sbin/suexec2"
-D DEFAULT_PIDLOG="/var/run/httpd2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/accept.lock"
-D DEFAULT_ERRORLOG="/var/log/apache2/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"
Und hast du den Apachen selber kompiliert ?
Nein, ein Image von Strato SuSe9.3 + Plesk7.54

wie sind die Rechte vom suexec.log ?
0644

mit Debug klappt bei mir nicht:
<IfDefine Debug>
LogLevel debug
</IfDefine>

#apache2ctl -D Debug restart
Usage: /usr/sbin/httpd2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t : run syntax check for config files


Und noch was, irgendetwas stimmt mit mime.types nicht
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: PHP5 als Fcgi

Post by Joe User »

Du beziehungsweise Dein Plesk setzt /var/www/foo/bar als Docroot, während SUSEs suexec /srv/www/htdocs als Docroot erwartet. Wie Du suexec mit angepasstem Docroot rekompilieren musst sagt Dir die SuFu...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Joe User was für sufu????
hast du ein link?
Vieln Dank im Voraus
Post Reply