• This forum has a zero tolerance policy regarding spam. If you register here to publish advertising, your user account will be deleted without further questions.

php-fpm verwirft POST-Parameter

threadi

Member
Hi,

ich habe eine Java-Anwendung die auf PCs von Anwendern läuft. Diese schickt in bestimmten Fällen HTTP-Requests an SSL-URLs. Sobald die hinter den SSL-URLs stehende PHP-Anwendung mit PHP-FPM betrieben wird (egal ob PHP 5.6 oder 7.0) kommen die mitgeschickten POST-Parameter nicht an - das $_POST ist schlicht leer.
Wenn ich mod_php verwende geht es jedoch. Ebenso funktioniert beim normalen Aufruf im Browser alles (auch Loginformulare oder Formulare mit Upload-Feldern - alles einwandfrei egal mit welcher PHP-(FPM-)Version).

Ich vermute derzeit noch eher ein Problem in der Java-Anwendung da die POST-Parameter ankommen sobald ich einen SSL-Request mittels php-curl an die gleiche URL schicke. Möchte aber nicht ausschließen, dass es an irgendeiner PHP-FPM-Einstellung liegt.

Vielleicht hat hier jemand eine Idee dazu?
 
Du meinst wohl Javascript.
Ich nehme an, du benutzt dann für Requests XHR?
Welches JS-Framework benutzt du zum Versenden der POST-Requests?
Wie sieht da der Code zum Versenden der Requests aus?
 
Schneide doch mal die von der Java-Anwendung gesendeten Requests über Fiddler mit.
Dann siehst du was rausgeht.

Dann mach dir mit PHP-FPM eine einfache Seite an die deine Java-Anwendung sendet und dir die GET- und POST-Requests als Debug ausgibt.

Dann siehst du was ankommt.
Oder hast du das alles schon getan?

Hängt zwischen Client udn Server noch ein Proxy wie NGINX o. ä.?
Welche Dateigröße hat denn der POST? Es kann da Grenzen geben.
 
Da der Stream SSL-verschlüsselt ist kommt beim Mitschneiden leider nichts brauchbares raus. Habs schon mit Wireshark versucht. Zudem kommen die POST-Parameter ja an sobald ich auf mod_php umschalte.

Und ja, den Rest was Du beschrieben hast hab ich schon gemacht.

Der POST ist minimalst, nur 1 Parameter mit einem Wert von 1. Also insgesamt zusammen mit dem Header keine 200 Bytes. Das gleiche passiert aber auch wenn ich eine 500kb-Datei auf dem Weg übertragen will.

Der einzige Proxy im Weg ist PHP-FPM, der nutzt den ja intern. Und verwendet wird ein Apache-Webserver, nicht nginx.
 
Poste bitte erst einmal den kompletten zugehörigen VirtualHost-Block des Apache.

.htaccess in Verwendung? Wenn ja, dann ebenfalls posten.
 
Gerne. Ist nur sehr viel. Der Server wird von ispconfig verwaltet, daher wird hier viel reingeneriert ;) Hab lediglich Domainnamen und IPs ersetzt.

Code:
<Directory /var/www/example.de>
        AllowOverride None
                Require all denied
        </Directory>

<VirtualHost 8.8.8.8:80>

                    DocumentRoot /var/www/clients/client1/web6/web
            
        ServerName example.de
        ServerAlias www.example.de
        ServerAdmin webmaster@example.de

        ErrorLog /var/log/ispconfig/httpd/example.de/error.log

        Alias /error/ "/var/www/example.de/web/error/"
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 502 /error/502.html
        ErrorDocument 503 /error/503.html

        <IfModule mod_ssl.c>
        </IfModule>

        <Directory /var/www/example.de/web>
                # Clear PHP settings of this website
                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                        SetHandler None
                </FilesMatch>
                Options +FollowSymLinks
                AllowOverride All
                                Require all granted
                        </Directory>
        <Directory /var/www/clients/client1/web6/web>
                # Clear PHP settings of this website
                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                        SetHandler None
                </FilesMatch>
                Options +FollowSymLinks
                AllowOverride All
                                Require all granted
                        </Directory>




        # suexec enabled
        <IfModule mod_suexec.c>
            SuexecUserGroup web6 client1
        </IfModule>
        <IfModule mod_fastcgi.c>
                <Directory /var/www/clients/client1/web6/cgi-bin>
                                        Require all granted
                                    </Directory>
                <Directory /var/www/example.de/web>
                    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
                    </FilesMatch>
                </Directory>
                <Directory /var/www/clients/client1/web6/web>
                    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
                    </FilesMatch>
                </Directory>
                Action php5-fcgi /php5-fcgi virtual
                Alias /php5-fcgi /var/www/clients/client1/web6/cgi-bin/php5-fcgi-8.8.8.8-80-example.de
                FastCgiExternalServer /var/www/clients/client1/web6/cgi-bin/php5-fcgi-8.8.8.8-80-example.de -idle-timeout 300 -socket /var/lib/php5-fpm/web6.sock -pass-header Authorization
        </IfModule>
        <IfModule mod_proxy_fcgi.c>
            #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php5-fpm/web6.sock|fcgi://localhost//var/www/clients/client1/web6/web/$1
            <Directory /var/www/clients/client1/web6/web>
                <FilesMatch "\.php[345]?$">
                        SetHandler "proxy:unix:/var/lib/php5-fpm/web6.sock|fcgi://localhost"
                </FilesMatch>
            </Directory>
            </IfModule>


        RewriteEngine on
        RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
        RewriteRule ^ - [END]
        RewriteCond %{HTTPS} off
                RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

        # add support for apache mpm_itk
        <IfModule mpm_itk_module>
            AssignUserId web6 client1
        </IfModule>

        <IfModule mod_dav_fs.c>
        # Do not execute PHP files in webdav directory
            <Directory /var/www/clients/client1/web6/webdav>
                <ifModule mod_security2.c>
                    SecRuleRemoveById 960015
                    SecRuleRemoveById 960032
                </ifModule>
                <FilesMatch "\.ph(p3?|tml)$">
                    SetHandler None
                </FilesMatch>
            </Directory>
            DavLockDB /var/www/clients/client1/web6/tmp/DavLock
            # DO NOT REMOVE THE COMMENTS!
            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
            # WEBDAV END
        </IfModule>



</VirtualHost>


<VirtualHost 8.8.8.8:443>

                    DocumentRoot /var/www/clients/client1/web6/web
            
        ServerName example.de
        ServerAlias www.example.de
        ServerAdmin webmaster@example.de

        ErrorLog /var/log/ispconfig/httpd/example.de/error.log

        Alias /error/ "/var/www/example.de/web/error/"
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 502 /error/502.html
        ErrorDocument 503 /error/503.html

        <IfModule mod_ssl.c>
        SSLEngine on
        SSLProtocol All -SSLv2 -SSLv3
        # SSLCipherSuite          ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
        SSLHonorCipherOrder     on
        # <IfModule mod_headers.c>
        # Header always add Strict-Transport-Security "max-age=15768000"
        # </IfModule>
        SSLCertificateFile /var/www/clients/client1/web6/ssl/example.de.crt
        SSLCertificateKeyFile /var/www/clients/client1/web6/ssl/example.de.key
        </IfModule>

        <Directory /var/www/example.de/web>
                # Clear PHP settings of this website
                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                        SetHandler None
                </FilesMatch>
                Options +FollowSymLinks
                AllowOverride All
                                Require all granted
                        </Directory>
        <Directory /var/www/clients/client1/web6/web>
                # Clear PHP settings of this website
                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                        SetHandler None
                </FilesMatch>
                Options +FollowSymLinks
                AllowOverride All
                                Require all granted
                        </Directory>




        # suexec enabled
        <IfModule mod_suexec.c>
            SuexecUserGroup web6 client1
        </IfModule>
        <IfModule mod_fastcgi.c>
                <Directory /var/www/clients/client1/web6/cgi-bin>
                                        Require all granted
                                    </Directory>
                <Directory /var/www/example.de/web>
                    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
                    </FilesMatch>
                </Directory>
                <Directory /var/www/clients/client1/web6/web>
                    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
                    </FilesMatch>
                </Directory>
                Action php5-fcgi /php5-fcgi virtual
                Alias /php5-fcgi /var/www/clients/client1/web6/cgi-bin/php5-fcgi-8.8.8.8-443-example.de
                FastCgiExternalServer /var/www/clients/client1/web6/cgi-bin/php5-fcgi-8.8.8.8-443-example.de -idle-timeout 300 -socket /var/lib/php5-fpm/web6.sock -pass-header Authorization
        </IfModule>
        <IfModule mod_proxy_fcgi.c>
            #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php5-fpm/web6.sock|fcgi://localhost//var/www/clients/client1/web6/web/$1
            <Directory /var/www/clients/client1/web6/web>
                <FilesMatch "\.php[345]?$">
                        SetHandler "proxy:unix:/var/lib/php5-fpm/web6.sock|fcgi://localhost"
                </FilesMatch>
            </Directory>
            </IfModule>


        RewriteEngine on
        RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
        RewriteRule ^ - [END]

        # add support for apache mpm_itk
        <IfModule mpm_itk_module>
            AssignUserId web6 client1
        </IfModule>

        <IfModule mod_dav_fs.c>
        # Do not execute PHP files in webdav directory
            <Directory /var/www/clients/client1/web6/webdav>
                <ifModule mod_security2.c>
                    SecRuleRemoveById 960015
                    SecRuleRemoveById 960032
                </ifModule>
                <FilesMatch "\.ph(p3?|tml)$">
                    SetHandler None
                </FilesMatch>
            </Directory>
            DavLockDB /var/www/clients/client1/web6/tmp/DavLock
            # DO NOT REMOVE THE COMMENTS!
            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
            # WEBDAV END
        </IfModule>



</VirtualHost>

<IfModule mod_ssl.c>
        SSLStaplingCache shmcb:/var/run/ocsp(128000)
</IfModule>

<VirtualHost [2001:4860:4860::8888]:80>

                    DocumentRoot /var/www/clients/client1/web6/web
            
        ServerName example.de
        ServerAlias www.example.de
        ServerAdmin webmaster@example.de

        ErrorLog /var/log/ispconfig/httpd/example.de/error.log

        Alias /error/ "/var/www/example.de/web/error/"
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 502 /error/502.html
        ErrorDocument 503 /error/503.html

        <IfModule mod_ssl.c>
        </IfModule>

        <Directory /var/www/example.de/web>
                # Clear PHP settings of this website
                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                        SetHandler None
                </FilesMatch>
                Options +FollowSymLinks
                AllowOverride All
                                Require all granted
                        </Directory>
        <Directory /var/www/clients/client1/web6/web>
                # Clear PHP settings of this website
                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                        SetHandler None
                </FilesMatch>
                Options +FollowSymLinks
                AllowOverride All
                                Require all granted
                        </Directory>




        # suexec enabled
        <IfModule mod_suexec.c>
            SuexecUserGroup web6 client1
        </IfModule>
        <IfModule mod_fastcgi.c>
                <Directory /var/www/clients/client1/web6/cgi-bin>
                                        Require all granted
                                    </Directory>
                <Directory /var/www/example.de/web>
                    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
                    </FilesMatch>
                </Directory>
                <Directory /var/www/clients/client1/web6/web>
                    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
                    </FilesMatch>
                </Directory>
                Action php5-fcgi /php5-fcgi virtual
                Alias /php5-fcgi /var/www/clients/client1/web6/cgi-bin/php5-fcgi-[2001:4860:4860::8888]-80-example.de
                FastCgiExternalServer /var/www/clients/client1/web6/cgi-bin/php5-fcgi-[2001:4860:4860::8888]-80-example.de -idle-timeout 300 -socket /var/lib/php5-fpm/web6.sock -pass-header Authorization
        </IfModule>
        <IfModule mod_proxy_fcgi.c>
            #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php5-fpm/web6.sock|fcgi://localhost//var/www/clients/client1/web6/web/$1
            <Directory /var/www/clients/client1/web6/web>
                <FilesMatch "\.php[345]?$">
                        SetHandler "proxy:unix:/var/lib/php5-fpm/web6.sock|fcgi://localhost"
                </FilesMatch>
            </Directory>
            </IfModule>


        RewriteEngine on
        RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
        RewriteRule ^ - [END]
        RewriteCond %{HTTPS} off
                RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

        # add support for apache mpm_itk
        <IfModule mpm_itk_module>
            AssignUserId web6 client1
        </IfModule>

        <IfModule mod_dav_fs.c>
        # Do not execute PHP files in webdav directory
            <Directory /var/www/clients/client1/web6/webdav>
                <ifModule mod_security2.c>
                    SecRuleRemoveById 960015
                    SecRuleRemoveById 960032
                </ifModule>
                <FilesMatch "\.ph(p3?|tml)$">
                    SetHandler None
                </FilesMatch>
            </Directory>
            DavLockDB /var/www/clients/client1/web6/tmp/DavLock
            # DO NOT REMOVE THE COMMENTS!
            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
            # WEBDAV END
        </IfModule>



</VirtualHost>


<VirtualHost [2001:4860:4860::8888]:443>

                    DocumentRoot /var/www/clients/client1/web6/web
            
        ServerName example.de
        ServerAlias www.example.de
        ServerAdmin webmaster@example.de

        ErrorLog /var/log/ispconfig/httpd/example.de/error.log

        Alias /error/ "/var/www/example.de/web/error/"
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 502 /error/502.html
        ErrorDocument 503 /error/503.html

        <IfModule mod_ssl.c>
        SSLEngine on
        SSLProtocol All -SSLv2 -SSLv3
        # SSLCipherSuite          ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
        SSLHonorCipherOrder     on
        # <IfModule mod_headers.c>
        # Header always add Strict-Transport-Security "max-age=15768000"
        # </IfModule>
        SSLCertificateFile /var/www/clients/client1/web6/ssl/example.de.crt
        SSLCertificateKeyFile /var/www/clients/client1/web6/ssl/example.de.key
        </IfModule>

        <Directory /var/www/example.de/web>
                # Clear PHP settings of this website
                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                        SetHandler None
                </FilesMatch>
                Options +FollowSymLinks
                AllowOverride All
                                Require all granted
                        </Directory>
        <Directory /var/www/clients/client1/web6/web>
                # Clear PHP settings of this website
                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                        SetHandler None
                </FilesMatch>
                Options +FollowSymLinks
                AllowOverride All
                                Require all granted
                        </Directory>




        # suexec enabled
        <IfModule mod_suexec.c>
            SuexecUserGroup web6 client1
        </IfModule>
        <IfModule mod_fastcgi.c>
                <Directory /var/www/clients/client1/web6/cgi-bin>
                                        Require all granted
                                    </Directory>
                <Directory /var/www/example.de/web>
                    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
                    </FilesMatch>
                </Directory>
                <Directory /var/www/clients/client1/web6/web>
                    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
                    </FilesMatch>
                </Directory>
                Action php5-fcgi /php5-fcgi virtual
                Alias /php5-fcgi /var/www/clients/client1/web6/cgi-bin/php5-fcgi-[2001:4860:4860::8888]-443-example.de
                FastCgiExternalServer /var/www/clients/client1/web6/cgi-bin/php5-fcgi-[2001:4860:4860::8888]-443-example.de -idle-timeout 300 -socket /var/lib/php5-fpm/web6.sock -pass-header Authorization
        </IfModule>
        <IfModule mod_proxy_fcgi.c>
            #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php5-fpm/web6.sock|fcgi://localhost//var/www/clients/client1/web6/web/$1
            <Directory /var/www/clients/client1/web6/web>
                <FilesMatch "\.php[345]?$">
                        SetHandler "proxy:unix:/var/lib/php5-fpm/web6.sock|fcgi://localhost"
                </FilesMatch>
            </Directory>
            </IfModule>


        RewriteEngine on
        RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
        RewriteRule ^ - [END]

        # add support for apache mpm_itk
        <IfModule mpm_itk_module>
            AssignUserId web6 client1
        </IfModule>

        <IfModule mod_dav_fs.c>
        # Do not execute PHP files in webdav directory
            <Directory /var/www/clients/client1/web6/webdav>
                <ifModule mod_security2.c>
                    SecRuleRemoveById 960015
                    SecRuleRemoveById 960032
                </ifModule>
                <FilesMatch "\.ph(p3?|tml)$">
                    SetHandler None
                </FilesMatch>
            </Directory>
            DavLockDB /var/www/clients/client1/web6/tmp/DavLock
            # DO NOT REMOVE THE COMMENTS!
            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
            # WEBDAV END
        </IfModule>



</VirtualHost>

<IfModule mod_ssl.c>
        SSLStaplingCache shmcb:/var/run/ocsp(128000)
</IfModule>
phpinfo() hab ich auch schon verglichen. Alle aus meiner Sicht für POST relevanten Werte sind bei mod_php mit 5.6 und und php-fpm mit 5.6 bzw. 7.0 identisch gesetzt (also z.B. enable_post_data_reading, post_max_size etc.). Bis auf post_max_size und upload_max_filesize (erhöht auf 25MB) ist alles auf Debian 8 Standard.

Nachtrag: für meinen Test hiervon verzichte ich auf eine .htaccess.
 
Wie genau versendest du diese Daten?
Sind diese ggfs. in der 'Datei' php://input ?
Kann man ganz einfach hiermit auslesen.

PHP:
$data = file_get_contents('php://input');
 
OK, die Apache-Konfiguration ist zwar extrem aufgebläht, enthält aber keine sichtbaren groben Fehler.
Sind die jeweiligen PHP-FPM Pool-Konfigurationen auch weitestgehend sauber?
Wenn Du PHP-FPM aktivierst, wird dann das Modul mod_fastcgi entladen?

Wird die PHP-Datei direkt aufgerufen, also als https://sub.domain.tld/path/file.php oder als https://sub.domain.tld/path/file oder per mod_rewrite oder irgendwie anders?

Je nachdem ob, wann und wie Debian nachgepatcht hat oder nicht, ist bei Verwendung von PHP-7.x im jeweiligen mod_proxy_fcgi Block folgende Zeile als Kompatibilitäts-Bugfix für PHP-FPM notwendig:
Code:
ProxyFCGIBackendType GENERIC

Ansonsten bitte mal alle Debug-Funktionen (Apache und PHP) aufdrehen und schauen ob eine potentielle Fehlerquelle zu Tage tritt.

Gegebenenfalls auch mal mit unverschlüsselten Verbindungen testen.
 
In php://input steht ebenfalls nichts.

Das Ziel für meinen Request ist eine tatsächlich vorhandene Datei die direkt aufgerufen wird, kein mod_rewrite, kein Rewriting von irgendetwas.

Habe heute auch mal ohne SSL getestet - keine Änderung im Verhalten.

mod_proxy_fcgi ist bei mir gar nicht aktiviert. Und php-fpm läuft offenbar mit mod_fastcgi.

Mit tcpdump hab ich auch geschaut, ob die Daten überhaupt am Server ankommen - ja tun sie. Alles andere wäre auch seltsam gewesen zumal es mit mod_php funktioniert, nur mit php-fpm nicht.

Ich habe heute aber mal einen anderen Test gemacht:
Ich schickte den Request an einen völlig anderen Server auf dem ich meine Datei für den Empfang ablegte. Dort erhielt ich dann als Rückmeldung den HTTP-Status 411. Mit dem hatte ich auch noch nie zu tun, er meckert das fehlen der Länge des POST-Requests an (Content-Length): https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/411

Aus Sicht von PHP-FPM kann ich das verstehen. Was soll der auch mit einem unsauberen HTTP-Request anfangen. Daher verwirft er offenbar jegliche POST-Requests, da er die auf Grund der fehlenden Längenangabe nicht laden kann.

Ergebnis für mich: ich muss meine Java-Klasse so umbauen, dass sie eine korrekte Content-Length mitschickt. Derzeit wird noch über setChunkedStreamingMode(-1) ein Chunked-Stream geschickt.
 
PHP-FPM funktioniert nicht mit mod_fastcgi, sondern nur mit mod_proxy_fcgi.

mod_fastcgi funktioniert nur mit PHPs völlig veralteter (deprecated) unstabilen FastCGI-Implementierung, welche mehr oder weniger nur in PHP-CGI reingehacked wurde.

PHP-FPM ist hingegen PHPs neue, eigenständige und stabile FastCGI-Implementierung.

Wenn Du also PHP-FPM aktivierst, musst Du auch zwingend mod_proxy_fcgi aktivieren und zwingend mod_fastcgi deaktivieren.
 
Hast recht mit fastcgi. Der Server wird von ispconfig verwaltet und ich habe nichts weiter angepasst. Daher passt das schon.

Die letztliche Lösung (falls jemand anderes mal darüber stolpert) hat weniger mit PHP oder fpm zu tun, eher mit Java. Genau wie oben geschrieben durfte ich keine chunked-header schicken, die ignoriert php-fpm offenbar (was ich auch gut so finde). Habe daher wie beschrieben meinen Java-Request umgebaut, so dass die korrekte Content-Length gesetzt wird - und es funktioniert einwandfrei sowohl mit als auch ohne php-fpm :)
 
Back
Top