php.ini bei apache2 mit fcgi und suexec

S

spex

Moin,

ich hab mir nun den Apache2 installiert mit php5 mit dem FCGI-Binary.
Ich will für jeden VHost eine eigene php.ini verwenden, was ja eigentlich in (ich nenne es mal) "fcgi-loader" Datei mittels "PHPRC=/var/www/fcgi/php/config", angegeben wird.
Nun sucht er aber (so steht es in der phpinfo()) im Ordner /etc/php5/apache2/ nach der php.ini.

Was muss ich ändern damit nun jeweils die php.ini aus dem Verzeichnis:
/var/www/example.com/php/config
geladen wird?

Betriebssystem:
Debian Etch 64Bit

Packete: libapache2-mod-fastcgi, apache2-mpm-worker, php5, php5-gd, php5-mysql, php5-cgi

PHP-FCGI Version:
Code:
PHP:  Error parsing /var/www/fcgi/config/php.ini on line 1336
PHP 5.2.0-8+etch11 (cgi-fcgi) (built: May 10 2008 10:29:59)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

Hier meine Konfigdateien:

/etc/apache2/mods-enabled/fastcgi.conf:
Code:
<IfModule mod_fastcgi.c>
        FastCgiIpcDir /var/lib/apache2/fastcgi
        FastCgiWrapper /usr/lib/apache2/suexec

        FastCgiConfig -minProcesses 1 \
                  -maxProcesses 400 \
                  -maxClassProcesses 5 \
                  -multiThreshold 80 \
                  -killInterval 60 \
                  -startDelay 5

        FastCgiServer /var/www/fcgi/phpfcgi -user vhost -group vhost -idle-timeout 300

        ## PHP5
        <Location /php/phpfcgi>
                SetHandler php5-fastcgi
                Options +ExecCGI
        </Location>

        Action php5-fastcgi /php/phpfcgi
        AddType application/x-httpd-php .php
</IfModule>

/var/www/fcgi/phpfcgi:
Code:
#!/bin/sh
PHPRC="/var/www/fcgi/config"
export PHPRC
PHP_FCGI_CHILDREN=2
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=500
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php5-cgi

/etc/apache2/sites-enabled/example.com:
Code:
NameVirtualHost 215.215.215.215
<VirtualHost 215.215.215.215>
        ServerAdmin admin@example.com
        ServerName example.com
        ServerAlias www.example.com

        DocumentRoot /var/www/example.com/htdocs
        DirectoryIndex index.php index.html index.htm index.txt

        SuexecUserGroup vhost1 vhost1

        <Directory /var/www/example.com/htdocs>
                AllowOverride All
                Options Indexes FollowSymLinks MultiViews
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /php/ /var/www/example.com/php/
        <Directory "/var/www/example.com/php">
                SetHandler php5-fastcgi
                AllowOverride None
                Options +ExecCGI -MultiViews -Indexes
                Order allow,deny
                Allow from all
        </Directory>

        LogLevel debug
        ErrorLog        /var/www/example.com/log/apache_error.log

        CustomLog       /var/www/example.com/log/apache_traff.log traff
        CustomLog       /var/www/example.com/log/apache_combined.log combined

</VirtualHost>

/var/www/example.com/php/phpfcgi:
Code:
#!/bin/sh
PHPRC="/var/www/example.com/php/config"
export PHPRC
PHP_FCGI_CHILDREN=2
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=500
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php5-cgi

Wenn ich nur: /usr/bin/php5-cgi eingebe, dann erhalte ich folgende Ausgabe:
PHP: Error parsing /var/www/fcgi/config/php.ini on line 1336
Jedoch befindet sich in der Zeile 1336 nur ein Kommentar:
Code:
;  foo = "none"  ; sets foo to the string 'none'

Gruss - Ich freue m ich über jede Antwort :)
 
Zuletzt bearbeitet von einem Moderator:
Der Apache php5 Mod war aktiv. Den hab ich jetzt abgeschaltet, nun kommt ein Fehler der folgendermassen aussieht:

Code:
[Fri Sep 05 13:46:22 2008] [error] [client 84.84.84.84] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Sep 05 13:46:16 2008] [debug] core.c(3027): [client 84.84.84.84] r->uri = /php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /php/phpfcgi/php/phpfcgi/php/phpfcgi/php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /php/phpfcgi/php/phpfcgi/php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /php/phpfcgi/php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /php/phpfcgi/index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /index.php
[Fri Sep 05 13:46:16 2008] [debug] core.c(3033): [client 84.84.84.84] redirected from r->uri = /
 
Zurück