PHP5 als Fcgi

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

PHP5 als Fcgi

Post by test022 »

Guten Tag,

Habe versucht anhand diesem HowTo PHP5 als FCGI zu installieren.
http://www.debianhowto.de/de:howtos:sar ... 2_php-fcgi

Bin aber beim Installation von mod_fastcgi auf ein Problem gestossen.

wenn ich make ausführe erscheint folgender Fehler:
In file included from fcgi_config.c:11:
/usr/include/apache2/mpm_common.h:37:17: mpm.h: No such file or directory
fcgi_config.c: In function `get_host_n_port':
fcgi_config.c:43: warning: passing arg 1 of `ap_strchr' discards qualifiers from pointer target type
fcgi_config.c: In function `fcgi_config_new_static_server':
fcgi_config.c:766: warning: long int format, gid_t arg (arg 3)
fcgi_config.c:771: warning: long int format, uid_t arg (arg 3)
fcgi_config.c: In function `fcgi_config_new_external_server':
fcgi_config.c:957: warning: long int format, gid_t arg (arg 3)
fcgi_config.c:962: warning: long int format, uid_t arg (arg 3)
make: *** [fcgi_config.slo] Fehler 1

woran liegt es?

System: SuSe 9.3 Professional
Admin Oberfläche: Plesk 7.54
Apache 2
Strato Image

Vielen Dank im Voraus
7lifes
Posts: 60
Joined: 2005-08-09 11:46
 

Re: PHP5 als Fcgi

Post by 7lifes »

ist mal ganz blöd gefragt. ihr könnt mich auch verbessern wenn ich nciht recht habe.

aber: plesk hat hardgecodet seine Syntax zum anlegen einer webpräsenz. Ich meine das diese nicht fastcgi einschließt, das heisst doch das jede virutal datei manuell an fastcgi angeglichen werden müsste. will man das?

nur mal so als frage...
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Da hats du recht, ich muss dannn jedem User per Hand in vHost.conf Eintrag machen. Aber ich brauche es nur für ein paar PHP5 als FCGI.
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: PHP5 als Fcgi

Post by Roger Wilco »

test022 wrote:woran liegt es?
Am fehlenden apache2-devel.
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

ob mir jemand glaubt oder nicht aber wenn ich etwas compilliere fange ich ertsmal mit yast und installiere alle betrofenen dev's

Kann noch irgend ein grund sein?
niemand
Posts: 142
Joined: 2003-12-12 18:36
 

Re: PHP5 als Fcgi

Post by niemand »

Kann noch irgend ein grund sein?
Falsch/nicht gesetzte include-Pfade.

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

Re: PHP5 als Fcgi

Post by test022 »

Also PHP5 habe ich erfolgreich compiliert :-)

Nun ein anderes Problem:

beim ausführen php5 scripte bekomme ich error 500, und im apache log ist folgender eintrag zu sehen:

Premature end of script headers: php

php5 habe wie folgt in apache includiert:

<Directory "/usr/bin/php5">
Order allow,deny
allow from all
Options ExecCGI
AllowOverride None
</Directory>

AddType application/x-httpd-php5 .php5
ScriptAlias /php/ "/usr/bin/php5/"
Action application/x-httpd-php5 "/php/php/"


was ist Falsch bei include?
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Keiner kann mir helfen?
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

/var/log/apache2/susexec.log ?
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

[2006-03-02 06:37:17]: too few arguments
[2006-03-02 06:37:22]: too few arguments

nur diese 2 Zeilen :-(
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

und
/var/log/apache2/error.log ?
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

und dein letzter slash ist bei Action ist mit Sicherheit zuviel !
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Also habe jetzt Eintrag in vhost.conf so abgeändert wie rOOty es empfohlen hat:
<Directory "/usr/bin/php5">
Order allow,deny
allow from all
Options ExecCGI
AllowOverride None
</Directory>

AddType application/x-httpd-php5 .php5
ScriptAlias /php/ "/usr/bin/php5/"
Action application/x-httpd-php5 "/php/php"


wenn ich jetzt auf info.php5 direkt zugreife meinedomain.de/info.php5
Pfad zu info.php5: /var/www/vhosts/meinedomain.de /httpdocs/info.php

bekomme ich:
Internal Server Error 500

In diesem Fall bleibt es in /var/log/apache2/susexec.log alles beim alten.
Und in /var/log/apache2/error.log kommt folgendes dazu: [Sat Apr 08 01:49:48 2006] [error] [client xx.xxx.xxx.xx] Premature end of script headers: php


Und wenn ich auf info.php5 aus Unterverzeichnis zugreife meinedomain.de/php/info.php5
Pfad zu info.php5: /var/www/vhosts/meinedomain.de/httpdocs/php/info.php

bekomme ich:
Not Found 400

Und in diesem Fall bleibt es auch in /var/log/apache2/susexec.log alles beim alten.
Und hier in /var/log/apache2/error.log kommt folgendes dazu: [Sat Apr 08 01:51:16 2006] [error] [client xx.xxx.xxx.xx] script not found or unable to stat: /usr/bin/php5/info.php5


Vielen Dank im Voraus
Last edited by test022 on 2006-04-10 18:45, edited 1 time in total.
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

so, ich bin wieder zurück aus dem Wochenende :-)
Also folgendes:
mich wundert dass du nicht die Meldung command not in docroot bekommst (suexec.log).
Aber soweit sind wir noch nicht - der Fehler ist wohl noch wo anders.
Hier mal ein Auszug aus der Config von mir, wie es bei mir funktioniert:

Code: Select all

  ServerName meineDomain.tld
  ServerAlias weitereDomains.tld

  DocumentRoot /home/htdocs/web28/html/
  SuexecUserGroup web28 web28
  ScriptAlias /cgi-bin/ /home/htdocs/web28/html/cgi-bin/
  Action php5-script /cgi-bin/php5/php
  AddHandler php5-script .php5
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

Also Leute jetzt im Ernst nicht dass, ich jemanden hier veräppeln will.

Aber es ist bei mir total komisch!!!
Habe auch Eintrag wie es rOOty gemacht hat ausprobiert hier sind die Meldungen aus error_log

Habe Datei hier ligen:
meinedomain.tld/php/info2.php5
also im Browser auf die Datei zugegriffen
error_log meldet: /File does not exist: /var/www/vhosts/ meinedomain.tld/httpdocs/php/php/info2.php5


Na gut noch ein Unterordner php erstellt und die Datei dorthin kopiert.
Wieder auf die Datei zugegriffen: meinedomain.tld/php/info2.php5
error_log meldet: /File does not exist: /var/www/vhosts/ meinedomain.tld/httpdocs/php/php/php/info2.php5


noch ein php Unterordner erstellt und die Datei dorthin kopiert.
Wieder auf die Datei zugegriffen: meinedomain.tld/php/info2.php5
error_log meldet: /File does not exist: /var/www/vhosts/ meinedomain.tld/httpdocs/php/php/php/php/info2.php5

Bitte um Hilfe.

Vielen Dank im voraus

PS: im suexec.log wieder keine veränderungen
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: PHP5 als Fcgi

Post by duergner »

Du scheinst da irgendwie Schleifen in deinen ScriptAlias und AddHandler Direktiven zu verursachen. Und du hast den Eintrag von rooty nicht komplett übernommen sondern das /php5/php durch ein php/php ausgetauscht, oder?
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

So habe ich jetzt in meinem vhost.conf stehen:

<Directory "/usr/bin/php5">
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 /php/ "/var/www/vhosts/meinedomain.tld/httpdocs/php/"
Action php5-script "/php"
AddHandler php5-script .php5

was soll jetzt noch verändert werden, bin wirklich ratlos...
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

okay, in welchem Verzeichnis liegt der php5 Interpreter ?
test022
Posts: 70
Joined: 2004-12-23 11:59
 

Re: PHP5 als Fcgi

Post by test022 »

cd /usr/bin/php5
/usr/bin/php5 # ./php -v
PHP 5.1.2 (cgi) (built: Mar 9 2006 01:17:49)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: PHP5 als Fcgi

Post by duergner »

Dann kann das ja nicht gehn.
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

okay, jetzt mach es doch mal so wie's bei mir ist:
kopiere den php-Interpreter nach
/var/www/vhosts/meinedomain.tld/httpdocs/cgi-bin/php5/php
und pass deine Config an (mit Apache Neustart)

Code: Select all

DocumentRoot /var/www/vhosts/meinedomain.tld/httpdocs/
SuexecUserGroup meinftpowner psacln
ScriptAlias /cgi-bin/ /var/www/vhosts/meinedomain.tld/httpdocs/cgi-bin/
Action php5-script "/cgi-bin/php5/php"
AddHandler php5-script .php5
und wenns tut dann verändere es so wie du es brauchst...

(dein ScriptAlias ist voll daneben - les dazu mal die Dokumentation)
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 »

So sollte es aussehen:

Code: Select all

gentoo ~ # php-cgi -v
PHP 5.1.2-gentoo with Hardening-Patch 0.4.8 (cgi-fcgi) (built: Apr  4 2006 12:19:12)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
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 »

Also habe jetzt auch Pfade mit übernomen und erstellt die nicht exestierten.

<Directory "/usr/bin/php5">
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 /cgi-bin/ /var/www/vhosts/meinedomain.tld/httpdocs/cgi-bin/
Action php5-script "/cgi-bin/php5"
AddHandler php5-script .php5



Kommt Fehler 404

und das erscheint wenn ich apache restart ausführe:

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=meinedomain.tld
h69416:/usr/bin/php5 # /etc/init.d/apache2 restart [Mon Apr 10 15:59:15 2006] [warn] The ScriptAlias directive in /var/www/vhosts/meinedomain.tld/conf/vhost.conf at line 13 will probably never match because it overlaps an earlier ScriptAlias.
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) [Mon Apr 10 15:59:17 2006] [warn] The ScriptAlias directive in /var/www/vhosts/meinedomain.tld/conf/vhost.conf at line 13 will probably never match because it overlaps an earlier ScriptAlias.
Done


suexec.log keine veränderungen

error_log:

das kommt wenn ich so auf die Datei zugreife http://www.meinedomain.tld/cgi-bin/php5/info.php5

[Mon Apr 10 15:58:03 2006] [error] [client xx.xxx.xxx.xx] script not found or unable to stat: /var/www/vhosts/meinedomain.tld/cgi-bin/php5

Und das kommt wenn ich so auf die Datei zugreife http://www.meinedomain.tld/cgi-bin/info.php5

[Mon Apr 10 15:58:08 2006] [error] [client xx.xxx.xxx.xx] File does not exist: /var/www/vhosts/meinedomain.tld/cgi-bin/info.php5
Last edited by test022 on 2006-04-10 18:45, edited 1 time in total.
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: PHP5 als Fcgi

Post by r00ty »

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
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 »

Und solange sein PHP nicht als FCGI kompiliert ist, wird es eh nicht wie gewünscht funktionieren...
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.
Post Reply