Apache + mod_fcgid + PHP/5.2.17 unter Windows

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

Apache + mod_fcgid + PHP/5.2.17 unter Windows

Postby Localhorst » 08. July 2011 11:26

Hallo Forum,

ich habe mich durch diverse Anleitungen zur Instalation von einem Apache Server mit mod_fcgid und PHP unter Windows gequält und bin doch nicht ans Ziel gekommen...

Bzgl. dem Aufsetzen des Servers habe ich geringe Kenntnisse und mich deswegen genau an die Anleitungen gehalten.Da diese mich aber nicht zum Ziel geführt haben, habe ich mit der Fehlersuche nun ein Problem. Ich versuche mal alle Infos die ich habe direkt in den ersten Post zu packen, wenn ich für euch wichtige Infos vergessen habe gebt mir bitte kurz Rückmeldung und ich reiche die gerne nach.

Was ich gemacht habe:

Apache/2.2.19 (Win32) installiert => läuft auch. "It works" Seite wurde angezeigt.


Hier mal die Apache Infos von PHPInfo:
Code: Select all
apache2handler
Apache Version    Apache/2.2.19 (Win32) PHP/5.2.17
Apache API Version    20051115
Server Administrator    .....
Hostname:Port    ....
Max Requests    Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts    Connection: 300 - Keep-Alive: 5
Virtual Server    No
Server Root    C:/Programme/Apache Software Foundation/Apache2.2
Loaded Modules    core mod_win32 mpm_winnt http_core mod_so mod_php5 mod_actions mod_alias mod_asis mod_auth_basic mod_authn_default mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_dir mod_env mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_setenvif


PHP/5.2.17 installiert. Läuft auch, siehe phpinfo() Ausgabe.

mod_fcgid installiert. Ob das läuft weiß ich leider nicht. In der error.log Datei des Apache gibt er mir folgende Zeile aus
Code: Select all
[Fri Jul 08 12:00:42 2011] [notice] Apache/2.2.19 (Win32) mod_fcgid/2.3.6 PHP/5.2.17 configured -- resuming normal operations

Der Apache startet auch und läuft. Aber ich kann keine PHP Dateien mehr Aufrufen, wenn ich den mod_fcgid in der httpd.conf lade.
Code: Select all
LoadModule fcgid_module modules/mod_fcgid.so

Wenn diese Zeile nicht auskommentiert ist erhalte ich folgende Fehlermeldung
Code: Select all
"Forbidden
You don't have permission to access /index.php on this server."


Ist sie auskommentiert sehe ich normal meine phpinfo() Seite.

Hier mal die drei Ausschnitte aus der http.conf an denen ich etwas geändert habe.
Code: Select all
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
[b]LoadModule php5_module "c:/php-5.2.17-Win32-VC6-x86/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "c:/php-5.2.17-Win32-VC6-x86/"

LoadModule fcgid_module modules/mod_fcgid.so
[/b]
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so


Code: Select all
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi .php
# Where to look for the php.ini file?
FcgidInitialEnv PHPRC        "c:/php-5.2.17-Win32-VC6-x86"
# Set PHP_FCGI_MAX_REQUESTS to greater than or equal to FcgidMaxRequestsPerProcess
# to prevent php-cgi process from exiting before all requests completed
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS      1000
# Maximum requests a process should handle before it is terminated
FcgidMaxRequestsPerProcess       1000
# Maximum number of PHP processes
FcgidMaxProcesses             15
# Number of seconds of idle time before a php-cgi process is terminated
FcgidIOTimeout             120
FcgidIdleTimeout                120
#Path to php-cgi
FcgidWrapper "c:/php-5.2.17-Win32-VC6-x86/php-cgi.exe" .php
# Define the MIME-Type for ".php" files
AddType application/x-httpd-php .php
</IfModule>


Code: Select all
<Directory "c:/Programme/Apache Software Foundation/Apache2.2/htdocs">
Options Indexes FollowSymLinks ExecCGI
Order allow,deny
Allow from all
AllowOverride All
</Directory>


Vielen Dank schon mal falls sich wirklich jemand bis hier hin durch meinen Post gearbeitet hat!
Über Hilfe (für einen Anfänger verständlich) würde ich mich sehr freuen.

Freundliche Grüße
Localhorst
Localhorst
 
Posts: 4
Joined: 08. July 2011 11:03

Re: Apache + mod_fcgid + PHP/5.2.17 unter Windows

Postby Nobbie » 08. July 2011 12:45

Wenn diese Zeile nicht auskommentiert ist erhalte ich folgende Fehlermeldung

Code: Select all
    "Forbidden
    You don't have permission to access /index.php on this server."


Das ist eigentlich schon einmal ein gutes Zeichen, das bedeutet schon mal, dass FCGID auch aktiv ist. Jetzt fehlt aber irgendwo eine Berechtigung, genauere Auskunft gibt Dir der Apache error_log (im log Verzeichnis).
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Apache + mod_fcgid + PHP/5.2.17 unter Windows

Postby Localhorst » 08. July 2011 12:54

Hi und danke schon mal für die Antwort.

Würde mich ja freuen, wenn ich zumindest nicht komplett daneben gelegen habe :-)

Hier mal die letzten Zeilen aus der error.log
Code: Select all
[Fri Jul 08 12:19:58 2011] [notice] Apache/2.2.19 (Win32) mod_fcgid/2.3.6 PHP/5.2.17 configured -- resuming normal operations
[Fri Jul 08 12:19:58 2011] [notice] Server built: May 20 2011 17:39:35
[Fri Jul 08 12:19:58 2011] [notice] Parent: Created child process 244
[Fri Jul 08 12:19:58 2011] [notice] Child 244: Child process is running
[Fri Jul 08 12:19:58 2011] [notice] Child 244: Acquired the start mutex.
[Fri Jul 08 12:19:58 2011] [notice] Child 244: Starting 64 worker threads.
[Fri Jul 08 12:19:58 2011] [notice] Child 244: Starting thread to listen on port 8080.


Die letzte Zeile aus der access.log schaut wie folgt aus.

Code: Select all
127.0.0.1 - - [08/Jul/2011:12:34:14 +0200] "GET /index.php HTTP/1.1" 403 211


Ich habe wie bereits geschrieben keine wirkliche Ahnung vom Aufsetzen, aber die Tatsache das ich mit der Zeile

"LoadModule fcgid_module modules/mod_fcgid.so"

einen Zugriffs Fehler bekomme und ohne die Zeile keinen irritiert mich. Wird PHP zusammen mit dem mod_fcgid anders aufgerufen oder hat php dann einen anderen Pfad in dem die index.php aufgerufen werden darf?

Freundliche Grüße
Localhorst
Localhorst
 
Posts: 4
Joined: 08. July 2011 11:03

Re: Apache + mod_fcgid + PHP/5.2.17 unter Windows

Postby Nobbie » 08. July 2011 14:07

Was gibst Du im Browser ein?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Apache + mod_fcgid + PHP/5.2.17 unter Windows

Postby Localhorst » 08. July 2011 15:17

Nobbie wrote:Was gibst Du im Browser ein?


http://127.0.0.1:8080/index.php


Ich glaube das ich auch wieder einen Schritt weiter bin. Ich habe mit die <Directory ...> Options ausversehen noch einmal überschrieben.

Unter diesem ersten Block

Code: Select all
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features. 
#
<Directory "c:/Programme/Apache Software Foundation/Apache2.2/htdocs">
Options Indexes FollowSymLinks +ExecCGI
Order allow,deny
Allow from all
AllowOverride All
</Directory>


Kam noch ein weiterer für den selben Pfad in dem das ExexCGI nicht mit drin war. Damit habe ich mir doch bestimmt die ersten Eingaben überschrieben, oder?

Wenn ich nun die die PHP Seite Aufrufe wird normal die PHPINFO Ausgabe angezeigt.
Ich bin halt nur nicht sicher ob wirklich alles richtig läuft, weil ein Folgeschritt nicht funktioniert.

Code: Select all
PHP Version 5.2.17

System    Windows NT MEDPC102 5.1 build 2600
Build Date    Jan 6 2011 17:26:08
Configure Command    cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-snapshot-template=d:\php-sdk\snap_5_2\vc6\x86\template" "--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--without-pi3web"
[b]Server API    CGI/FastCGI[/b]



Das geht nun bestimmt über dieses Forum hinaus, aber ich brauche den mod_fcgid für den IIPImage Server, dieser Teil klappt dann nicht mehr und ich bekomme jede Menge Fehler in meine Log Datei geschrieben. Nämlich solche hier

Code: Select all
[Fri Jul 08 15:37:42 2011] [error] (OS 2)Das System kann die angegebene Datei nicht finden.  : mod_fcgid: can't run C:/Programme/Apache
[Fri Jul 08 15:37:42 2011] [warn] (OS 2)Das System kann die angegebene Datei nicht finden.  : mod_fcgid: spawn process C:/Programme/Apache Software Foundation/Apache2.2/fcgi-bin/IIPImageServer.fcgi error
[Fri Jul 08 15:37:43 2011] [error] (OS 2)Das System kann die angegebene Datei nicht finden.  : mod_fcgid: can't run C:/Programme/Apache
[Fri Jul 08 15:37:43 2011] [warn] (OS 2)Das System kann die angegebene Datei nicht finden.  : mod_fcgid: spawn process C:/Programme/Apache Software Foundation/Apache2.2/fcgi-bin/IIPImageServer.fcgi error
[Fri Jul 08 15:37:44 2011] [error] (OS 2)Das System kann die angegebene Datei nicht finden.  : mod_fcgid: can't run C:/Programme/Apache
[Fri Jul 08 15:37:44 2011] [warn] (OS 2)Das System kann die angegebene Datei nicht finden.  : mod_fcgid: spawn process C:/Programme/Apache Software Foundation/Apache2.2/fcgi-bin/IIPImageServer.fcgi error
[Fri Jul 08 15:37:45 2011] [error] (OS 2)Das System kann die angegebene Datei nicht finden.  : mod_fcgid: can't run C:/Programme/Apache
[Fri Jul 08 15:37:45 2011] [warn] (OS 2)Das System kann die angegebene Datei nicht finden.  : mod_fcgid: spawn process C:/Programme/Apache Software Foundation/Apache2.2/fcgi-bin/IIPImageServer.fcgi error
[b][Fri Jul 08 15:37:45 2011] [warn] [client 127.0.0.1] mod_fcgid: can't apply process slot for C:/Programme/Apache Software Foundation/Apache2.2/fcgi-bin/IIPImageServer.fcgi[/b]
[Fri Jul 08 15:37:45 2011] [notice] Child 3280: All worker threads have exited.
[b][Fri Jul 08 15:37:53 2011] [error] FastCGI process 840 still did not exit, terminating forcefully[/b]
[Fri Jul 08 15:37:54 2011] [notice] Child 3280: Child process is exiting
[Fri Jul 08 16:08:35 2011] [warn] pid file C:/Programme/Apache Software Foundation/Apache2.2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?


Die access.log enthält dann folgende Meldung
Code: Select all
127.0.0.1 - - [08/Jul/2011:16:09:13 +0200] "GET /fcgi-bin/IIPImageServer.fcgi HTTP/1.1" 503 323


Aber wie gesagt, ist hier ja kein Forum für den IIPImage Server... Schade :-)

Vielen Dank schon mal und wenn du trotzdem Ideen hast höre ich mir die gerne an!

grüße
Localhorst
Localhorst
 
Posts: 4
Joined: 08. July 2011 11:03

Re: Apache + mod_fcgid + PHP/5.2.17 unter Windows

Postby Nobbie » 08. July 2011 21:33

Localhorst wrote:Aber wie gesagt, ist hier ja kein Forum für den IIPImage Server... Schade :-)


Kenn ich auch nicht - nie gehört.

Ich frage mich nur - wenn das alles so Neuland ist für Dich, wieso musst dann ausgerechnet Du das alles einrichten?

P-S.: War mir allerdings auf Anhieb auffällt, ist die Tatsache, dass die Spaces im Verzeichnisnamen "Apache Software .." ein Problem darstellen. Ich weiß nicht, wo dieser Pfadname auftaucht, aber ich würde auf Nummer sicher gehen und die Installation in ein Verzeichnis ohne Spaces im Namen durchziehen. Ansonsten musst Du alle Stellen finden, wo dieser Pfadname in der Konfiguration benutzt wird und sicherstellen, dass Quotes ("Gänsefüßchen") drum herum sind. Die Fehlermeldungen sind zumindest (teilweise) eindeutig.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Apache + mod_fcgid + PHP/5.2.17 unter Windows

Postby Localhorst » 11. July 2011 06:19

Hallo und danke schon mal.

Ich bin gerade dabei ein Testsystem aufzusetzen. Sollte diese Technik für uns geeignet sein werden wir damit mit Sicherheit Profis beauftragen und nicht mich mit meinem Forumswissen auf die Welt los lassen. Aber um alles zu testen muß ich erst einmal ein lokales System auf die Beine stellen, was ich dann den Chefs zeigen kann.

Ich mach mich erst mal daran die Pfade zu ändern :-).... werden ja einige stellen sein....


Gruß
Localhorst
Localhorst
 
Posts: 4
Joined: 08. July 2011 11:03


Return to Apache

Who is online

Users browsing this forum: No registered users and 38 guests