Apache2 + php = weisse Seite

Broesel01

New Member
Moin Moin zusammen,

ich habe vorgestern meinen Server mit Plesk neu aufgesetzt. Seitdem sind alle Ausgaben der .php-Files weiss.

OS: Debian 7.0
Apache Version: 2.2.22
PHP-Version: 5.4
Plesk: 17.5.3

Die Ausgabe des Testfiles ist eine weisse Seite :(

Testfile
PHP:
<?php 

error_reporting(E_ALL | E_STRICT);
ini_set("display_errors", 1); 

echo "Hallo Welt!";
phpinfo ()

?>

Ich habe jetzt alles mögliche bei Google gesucht und leider keine Lösung gefunden.

Alle Logfiles enthalten KEINEN Fehler :(

Das Module php5 ist geladen.

Schon jetzt vielen Dank für eure Unterstützung.

Gruss
Broesel01
 
Last edited by a moderator:
Guten Morgen,

vermutlich ist die PHP Fehleranzeige display_errors in der php.ini als disable_function deklariert. Diese einfach aktivieren, dann sollte es etwas ausgeben.
 
prüf doch mal den genauen Returncode und Response - z.B. mit FF-Entwicklertools oder per curl / wget-Abruf an der Konsole.

"Gern genommen" ist auch mal Browsercache leeren.
 
Moin Moin,

nach der Arbeit hab ich mich mal nochmal dran gesetzt und einiges umgebaut.

Komisch ist, dass die Plesk interne phpinfo funktioniert. Die selbst erstellte unter meiner Domain funktioniert nicht :(

Selbst den Server habe ich neu aufgesetzt in der Hoffnung, dass der Fehler hier lag.

Neues System:
- nginx version 1.11.1
- PHP Version 5.6.30
- Apache Version 2.4.10
- Debian Linux 8.8
- Plesk Version: 12.5.30

Die Plesk interne phpinfo gibt es hier.

Sieht da jemand von euch einen Fehler? Hat jemand eine Idee woran es liegen kann, dass alle php-Seiten weiss sind?

Browsercache wurde mehrfach gelehrt.
 
Testfile
PHP:
<?php 

error_reporting(E_ALL | E_STRICT);
ini_set("display_errors", 1); 

echo "Hallo Welt!";
phpinfo ()

?>

Ich hab jetzt mit PHP nicht viel am Hut, deswegen könnte die folgende Frage absoluter Quatsch sein (:rolleyes:), aber gehört nicht hinter
PHP:
phpinfo ()
ein Semikolon?
 
Ich hab jetzt mit PHP nicht viel am Hut, deswegen könnte die folgende Frage absoluter Quatsch sein (:rolleyes:), aber gehört nicht hinter
PHP:
phpinfo ()
ein Semikolon?

Genau so ist ist. Un je nach Einstellung wird erst gar keine Fehlermeldung ausgegeben.

Auch ein error_reporting(E_ALL | E_STRICT); in der PHP File führt zwangsläufig nicht zu einer Ausgabe der Fehlermeldung.

PHP:
<?php
    phpinfo();
?>

Reicht bei einer frischen Plesk Installation aus.
 
Last edited by a moderator:
Den Kosolen-Abruf hast Du probiert? Was passiert, wenn Du die Datei mit php-cli ausführst? Siehst Du den Request im access-Log? Wie sieht die Server-Konfiguration aus?

Ohne Infos kann Dir auch keiner helfen.
 
Moin Moin,

hier mal die ganzen Konfigurationen. Wenn was fehlt bitte Bescheid geben ich reich es dann gerne nach.

/etc/nginx/nginx.conf
Code:
#user  nginx;
worker_processes  1;

#error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

#pid        /var/run/nginx.pid;

include /etc/nginx/modules.conf.d/*.conf;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    #tcp_nodelay        on;

    #gzip  on;
    #gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    server_tokens off;

    include /etc/nginx/conf.d/*.conf;
}

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;

/etc/nginx/conf.d/zz010_psa_nginx.conf
Code:
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
include /etc/nginx/plesk.conf.d/server.conf;
include /etc/nginx/plesk.conf.d/webmail.conf;
include /etc/nginx/plesk.conf.d/vhosts/*.conf;
include /etc/nginx/plesk.conf.d/forwarding/*.conf;
include /etc/nginx/plesk.conf.d/wildcards/*.conf;

include /etc/nginx/plesk.conf.d/server.conf
Code:
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

include "/etc/nginx/plesk.conf.d/ip_default/*.conf";

server {
	listen 94.23.36.61:80;

	location ^~ /plesk-site-preview/ {
		proxy_pass http://127.0.0.1:8880;
		proxy_set_header Host             plesk-site-preview.local;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		access_log off;
	}

	location / {
		proxy_pass http://94.23.36.61:7080;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

server {
	listen [2001:41d0:2:253d::]:80 ipv6only=on;

	location ^~ /plesk-site-preview/ {
		proxy_pass http://127.0.0.1:8880;
		proxy_set_header Host             plesk-site-preview.local;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		access_log off;
	}

	location / {
		proxy_pass http://[2001:41d0:2:253d::]:7080;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

server {
	listen 178.32.115.20:80;

	location ^~ /plesk-site-preview/ {
		proxy_pass http://127.0.0.1:8880;
		proxy_set_header Host             plesk-site-preview.local;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		access_log off;
	}

	location / {
		proxy_pass http://178.32.115.20:7080;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

server {
	listen 213.32.81.251:80;

	location ^~ /plesk-site-preview/ {
		proxy_pass http://127.0.0.1:8880;
		proxy_set_header Host             plesk-site-preview.local;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		access_log off;
	}

	location / {
		proxy_pass http://213.32.81.251:7080;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

server {
	listen 94.23.36.61:443 ssl;

	ssl_certificate             /opt/psa/var/certificates/certFbB5vQG;
	ssl_certificate_key         /opt/psa/var/certificates/certFbB5vQG;

	location ^~ /plesk-site-preview/ {
		proxy_pass http://127.0.0.1:8880;
		proxy_set_header Host             plesk-site-preview.local;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		access_log off;
	}

	location / {
		proxy_pass https://94.23.36.61:7081;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

server {
	listen [2001:41d0:2:253d::]:443 ipv6only=on ssl;

	ssl_certificate             /opt/psa/var/certificates/certFbB5vQG;
	ssl_certificate_key         /opt/psa/var/certificates/certFbB5vQG;

	location ^~ /plesk-site-preview/ {
		proxy_pass http://127.0.0.1:8880;
		proxy_set_header Host             plesk-site-preview.local;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		access_log off;
	}

	location / {
		proxy_pass https://[2001:41d0:2:253d::]:7081;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

server {
	listen 178.32.115.20:443 ssl;

	ssl_certificate             /opt/psa/var/certificates/certFbB5vQG;
	ssl_certificate_key         /opt/psa/var/certificates/certFbB5vQG;

	location ^~ /plesk-site-preview/ {
		proxy_pass http://127.0.0.1:8880;
		proxy_set_header Host             plesk-site-preview.local;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		access_log off;
	}

	location / {
		proxy_pass https://178.32.115.20:7081;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

server {
	listen 213.32.81.251:443 ssl;

	ssl_certificate             /opt/psa/var/certificates/certFbB5vQG;
	ssl_certificate_key         /opt/psa/var/certificates/certFbB5vQG;

	location ^~ /plesk-site-preview/ {
		proxy_pass http://127.0.0.1:8880;
		proxy_set_header Host             plesk-site-preview.local;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		access_log off;
	}

	location / {
		proxy_pass https://213.32.81.251:7081;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
}

/var/www/vhosts/system/bvg.ovh/conf/nginx.conf
Code:
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

server {
	listen 178.32.115.20:80;

	server_name bvg.ovh;
	server_name www.bvg.ovh;
	server_name ipv4.bvg.ovh;

	client_max_body_size 128m;

	root "/var/www/vhosts/bvg.ovh/httpdocs";
	access_log "/var/www/vhosts/system/bvg.ovh/logs/proxy_access_log";
	error_log "/var/www/vhosts/system/bvg.ovh/logs/proxy_error_log";

	if ($host ~* ^www.bvg.ovh$) {
		rewrite ^(.*)$ http://bvg.ovh$1 permanent;
	}

	location / {
		proxy_pass http://178.32.115.20:7080;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;
	}

	location /internal-nginx-static-location/ {
		alias /var/www/vhosts/bvg.ovh/httpdocs/;
		add_header X-Powered-By PleskLin;
		internal;
	}

	location ~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon) {
		proxy_pass http://178.32.115.20:7080;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;
	}

	location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
		alias /var/www/vhosts/bvg.ovh/web_users/$1/$2;
		fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_pass "unix:///var/www/vhosts/system/bvg.ovh/php-fpm.sock";
		include /etc/nginx/fastcgi.conf;
	}

	location ~ ^/~(.+?)(/.*)?$ {
		proxy_pass http://178.32.115.20:7080;
		proxy_set_header Host             $host;
		proxy_set_header X-Real-IP        $remote_addr;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-Accel-Internal /internal-nginx-static-location;
		access_log off;
	}

	location ~ \.php(/.*)?$ {
		fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		fastcgi_pass "unix:///var/www/vhosts/system/bvg.ovh/php-fpm.sock";
		include /etc/nginx/fastcgi.conf;
	}

	location ~ /$ {
		index index.html index.cgi index.pl index.php index.xhtml index.htm index.shtml;
	}

}

Komisch ist, dass ich keinen Eintrag in der access.log habe sondern nur in der proxy_acess.log wenn ich die Seite aufrufe. Die error-logs sind weiterhin leer.

proxy_access.log
Code:
xx.xx.29.153 - - [24/May/2017:15:21:11 +0200] "GET /index.php HTTP/1.1" 200 61 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0"

php5-fpm.log
Code:
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=8, "/var/www/vhosts/system/bvg.ovh/php-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=8, "/var/www/vhosts/system/123.de/php-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=9, "/var/www/vhosts/system/234.de/php-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=9, "/var/www/vhosts/system/234.de/php-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=10, "/var/www/vhosts/system/345.de/php-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=10, "/var/www/vhosts/system/345.de/php-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=11, "/var/www/vhosts/system/456.de/php-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=11, "/var/www/vhosts/system/456.de/php-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=12, "/var/run/php5-fpm.sock"
[24-May-2017 00:06:13] NOTICE: using inherited socket fd=12, "/var/run/php5-fpm.sock"
[24-May-2017 00:06:13] NOTICE: fpm is running, pid 24684
[24-May-2017 00:06:13] NOTICE: ready to handle connections
[24-May-2017 00:06:13] NOTICE: systemd monitor interval set to 10000ms
[24-May-2017 15:19:37] NOTICE: Terminating ...
[24-May-2017 15:19:37] NOTICE: exiting, bye-bye!
[24-May-2017 15:19:37] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

[24-May-2017 15:19:38] NOTICE: fpm is running, pid 3663
[24-May-2017 15:19:38] NOTICE: ready to handle connections
[24-May-2017 15:19:38] NOTICE: systemd monitor interval set to 10000ms
 
Last edited by a moderator:
I guess PHP should run as FastCGI with your plesk.
Please show your fastcgi config.

Andy_24-05-2017_15-05-31.png


[Edit]
Konnte die Config jetzt doch finden :)

fastcgi.conf
Code:
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  REQUEST_SCHEME     $scheme;
fastcgi_param  HTTPS              $https if_not_empty;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

# https://httpoxy.org/
fastcgi_param  HTTP_PROXY         "";
 
Last edited by a moderator:
Moin Moin,

der Fehler wurde gefunden *freu*

Das File war - was ich nicht verstehe - im falschen Format auf den Server kopiert worden, sodass nur noch Asciizeichen darin waren.

Herzlichen Dank an alle die versucht haben zu helfen.

@Moderator
Bitte close
 
Back
Top