PHP funktioniert nicht mehr auf Apache2-Server?

2 Antworten

Vom Beitragsersteller als hilfreich ausgezeichnet
Warum funktioniert nach dem neustart auf meinem Apache2-Server kein PHP mehr?

Die Frage ist ja schon falsch gestellt. In den Kommentaren erfährt man dann, dass Du Konfigurationsänderungen vorgenommen hast. Der Neustart ist also nicht die Ursache.

Werde konkret. Zeige vollständige Konfigurationsdateien. Außerdem: Was sagen

sudo apachectl -S

und

sudo apachectl -M | grep -i php

Gibt es eine Logdatei /var/log/php7.x-fpm.log (das x bitte entsprechend Deiner PHP-Version ersetzen)? Wenn ja, was steht drin?


plantgrower321 
Beitragsersteller
 23.01.2021, 15:36
sudo apachectl -M | grep -i php

gibt

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

aus, obwohl ich ein ServerName festgelegt habe.

Gibt es eine Logdatei /var/log/php7.x-fpm.log (das x bitte entsprechend Deiner PHP-Version ersetzen)?

Nein, es gibt keine.

0
franzhartwig  23.01.2021, 16:04
@plantgrower321

Ich habe nach zwei Ausgaben gefragt, bekomme nur eine. Hat das einen besonderen Grund? Also:

sudo apachectl -S

Die Meldung von apachectl -M können wir erst mal vernachlässigen. Das verhindert nicht die Funktion von PHP.

Was sagt

sudo apachectl -M 

und

php -version

?

0
plantgrower321 
Beitragsersteller
 23.01.2021, 17:53
@franzhartwig
sudo apachectl -M

gibt

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_event_module (shared)
 negotiation_module (shared)
 reqtimeout_module (shared)
 setenvif_module (shared)
 status_module (shared)

aus, und die PHP-Version ist 7.3.

0
franzhartwig  23.01.2021, 18:06
@plantgrower321

Warum weigerst Du Dich, die Ausgabe von

apachectl -S

zu zeigen? Ich frage jetzt das dritte Mal danach.

0
plantgrower321 
Beitragsersteller
 23.01.2021, 18:33
@franzhartwig
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80          y***********5.d**s.net (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex proxy: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
0
franzhartwig  23.01.2021, 19:49
@plantgrower321

Gut, das sieht alles unauffällig aus. Was sagt

sudo systemctl status php7.3-fpm

? Wenn dort nicht in grün steht

Active: active (running)

sondern etwas rotes oder nur weißes, dann bitte:

sudo systemctl restart php7.3-fpm

Anschließend noch einmal

sudo systemctl status php7.3-fpm

und die Ausgabe dann hierher kopieren.

0
franzhartwig  23.01.2021, 23:19
@plantgrower321

Dann bitte:

sudo apt install php7.3-fpm

Wenn das nicht hilf, einmal den vollständigen Inhalt von

/etc/apache2/sites-enabled/000-default.conf

0
plantgrower321 
Beitragsersteller
 24.01.2021, 08:34
@franzhartwig
<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
0
franzhartwig  24.01.2021, 12:39
@plantgrower321

Grmpf, ich habe nicht wahrgenommen, dass wir auf der vHost-Baustelle auch schon miteinander zu tun hatten. Die vHosts funktionierten doch am Ende, oder täusche ich mich?

Interpretiere ich den Kommentar jetzt richtig, dass die Installation von php7.3-fpm nichts gebracht hat?

Bis Du sicher, dass der PHP-Code fehlerfrei ist?

0
plantgrower321 
Beitragsersteller
 24.01.2021, 18:57
@franzhartwig

Ja, bisher hatte er immer funktioniert. Und auch der PHP-Code von Pihole funktioniert nicht.

0
plantgrower321 
Beitragsersteller
 25.01.2021, 07:47
@franzhartwig

Die Vitual Hostst funktionieren, und die Installation von php7.3 hat auch nichts gebracht.

0
franzhartwig  26.01.2021, 08:34
@plantgrower321

Dann hilft ist es Zeit, PHP einfach mal neu zu installieren. Wie ist die Ausgabe von

dpkg -l | grep php

?

0
plantgrower321 
Beitragsersteller
 26.01.2021, 11:17
@franzhartwig

Die Ausgabe ist:

ii  libapache2-mod-php                                          2:7.3+69                                                   all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
ii  libapache2-mod-php7.3                                       7.3.19-1~deb10u1                                           armhf        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php                                                         2:7.3+69                                                   all          server-side, HTML-embedded scripting language (default)
ii  php-cgi                                                     2:7.3+69                                                   all          server-side, HTML-embedded scripting language (CGI binary) (default)
ii  php-common                                                  2:69                                                       all          Common files for PHP packages
ii  php-intl                                                    2:7.3+69                                                   all          Internationalisation module for PHP [default]
ii  php-json                                                    2:7.3+69                                                   all          JSON module for PHP [default]
ii  php-sqlite3                                                 2:7.3+69                                                   all          SQLite3 module for PHP [default]
ii  php-xml                                                     2:7.3+69                                                   all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii  php7.3                                                      7.3.19-1~deb10u1                                           all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.3-cgi                                                  7.3.19-1~deb10u1                                           armhf        server-side, HTML-embedded scripting language (CGI binary)
ii  php7.3-cli                                                  7.3.19-1~deb10u1                                           armhf        command-line interpreter for the PHP scripting language
ii  php7.3-common                                               7.3.19-1~deb10u1                                           armhf        documentation, examples and common module for PHP
ii  php7.3-fpm                                                  7.3.19-1~deb10u1                                           armhf        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.3-intl                                                 7.3.19-1~deb10u1                                           armhf        Internationalisation module for PHP
ii  php7.3-json                                                 7.3.19-1~deb10u1                                           armhf        JSON module for PHP
ii  php7.3-opcache                                              7.3.19-1~deb10u1                                           armhf        Zend OpCache module for PHP
ii  php7.3-readline                                             7.3.19-1~deb10u1                                           armhf        readline module for PHP
ii  php7.3-sqlite3                                              7.3.19-1~deb10u1                                           armhf        SQLite3 module for PHP
ii  php7.3-xml                                                  7.3.19-1~deb10u1                                           armhf        DOM, SimpleXML, WDDX, XML, and XSL module for PHP


0
franzhartwig  26.01.2021, 11:26
@plantgrower321

Dann einfach mal:

sudo apt install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" libapache2-mod-php libapache2-mod-php7.3 php php-cgi php-common php-intl php-json php-sqlite3 php-xml php7.3 php7.3-cgi php7.3-cli php7.3-common php7.3-fpm php7.3-intl php7.3-json php7.3-opcache php7.3-readline php7.3-sqlite3 php7.3-xml

Damit werden alle PHP-relevanten Pakete neu installiert, die Default-Konfiguration wiederhergestellt und eventuell fehlende Konfigurationsdateien wieder installiert.

0
franzhartwig  26.01.2021, 13:31
@plantgrower321

Du hast irgendwo eine Konfigurationsdatei entweder gelöscht, verschoben oder ungesund verändert. Das Problem ist das "irgendwo". Du musst dringed daran arbeiten, das zu verstehen, was Du machst. Das einfache abtippern von Anleitungen oder Nachmachen von Video-Tutorials funktioniert zwar häufig. Im Fehlerfall steht man aber da und weiß nicht, wo man ansetzen soll.

Wenn man etwas ändert, sollte man von der zu ändernden Datei eine Sicherungskopie anlegen, sodass man diese leicht wieder herstellen kann. Man sollte sich auch genau notieren, was man gemacht hat, damit man wieder zurückrollen kann.

Zudem solltest Du Dir mindestens von allen von Dir veränderten Dateien eine Kopie beiseite legen, falls dem Server mal etwas passiert und Du z. B. etwas neu installieren musst.

0
plantgrower321 
Beitragsersteller
 26.01.2021, 17:32
@franzhartwig

Das ist mir auch durch den Sinn gekommen und werde ich bald machen. Ich habe auch vor mich über alles zu informieren.

0

wie findest du den raus das es nicht funktoiniert ?

was sagen die error log dateien vom apache2

welches betriebssystem ?


plantgrower321 
Beitragsersteller
 23.01.2021, 14:23
wie findest du den raus das es nicht funktoiniert ?

Es wird der PHP-Quellcode angezeigt.

was sagen die error log dateien vom apache2

Nichts

welches betriebssystem ?

Raspbian

0
TechPech1984  23.01.2021, 14:24
@plantgrower321

dann mal überlegen was du so vor deinem neustart gemacht hattest . scheint wohl irgendeine config oder version ein problem zu machen .

0
DodgeRT  23.01.2021, 14:38
@plantgrower321

dir is bewusst, dass wir keine ahnung haben wie deine config aussieht, oder? sollen wir jetzt blind losraten?

mach des rückgängi was gemacht hast und versuchs nochmal.

1
plantgrower321 
Beitragsersteller
 23.01.2021, 14:55
@DodgeRT

Habe alles Rückgängig gemacht, klappt aber leider immer noch nicht.

0