Keine Verbindung zur Datenbank

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
schwedenmann
Beiträge: 5529
Registriert: 30.12.2004 15:31:07
Wohnort: Wegberg

Re: Keine Verbindung zur Datenbank

Beitrag von schwedenmann » 02.06.2020 19:39:01

Hallo

dann erscheint wie gewohnt die Apache2 Debian Default Page.
so sollte s sein.

Wir habne uns da mißverstanden. Ich bin von einem Server mit graf. ausgegangen auf dem du gerade eingeloggt bist.

Jetzt mach dasselbe mit der info.php, also im Browser

http://IPvomserrver/info.php, du mußt nat. die info.php auf dem server erstellen und in richtige Verzeichnis kopieen.

mfg
schwdenmann

Bebbi
Beiträge: 172
Registriert: 21.11.2014 23:55:14

Re: Keine Verbindung zur Datenbank

Beitrag von Bebbi » 02.06.2020 19:44:13

Hallo,

dann wird den Inhalt der Datei angezeigt:
<?php
phpinfo();
?>

schwedenmann
Beiträge: 5529
Registriert: 30.12.2004 15:31:07
Wohnort: Wegberg

Re: Keine Verbindung zur Datenbank

Beitrag von schwedenmann » 02.06.2020 20:07:10

Hallo


starte den apache neu und starte auch den Browser neu.

Dann noch mal die info.php aufrufen.

mfg
schwedenmann

Falls das auch nciht klappt, makl a2enmod php7.3 ausführen

Bebbi
Beiträge: 172
Registriert: 21.11.2014 23:55:14

Re: Keine Verbindung zur Datenbank

Beitrag von Bebbi » 02.06.2020 21:05:01

Hallo,

dann wird weiterhin der Inhalt angezeigt der Datei - in Opera. In Edge wird gar nichts angezeigt.

Code: Alles auswählen

# a2enmod php7.3
Considering dependency mpm_prefork for php7.3:
Considering conflict mpm_event for mpm_prefork:
ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Considering conflict mpm_worker for mpm_prefork:
ERROR: Could not enable dependency mpm_prefork for php7.3, aborting
# a2dismod mpm_prefork
Module mpm_prefork already disabled

Benutzeravatar
GTAzoccer
Beiträge: 13
Registriert: 25.08.2018 23:03:02
Wohnort: Baden-Württemberg
Kontaktdaten:

Re: Keine Verbindung zur Datenbank

Beitrag von GTAzoccer » 02.06.2020 23:26:11

Bebbi hat geschrieben: ↑ zum Beitrag ↑
02.06.2020 21:05:01
# a2enmod php7.3
Considering dependency mpm_prefork for php7.3:
Considering conflict mpm_event for mpm_prefork:
ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Considering conflict mpm_worker for mpm_prefork:
ERROR: Could not enable dependency mpm_prefork for php7.3, aborting
# a2dismod mpm_prefork
Module mpm_prefork already disabled
Ich nehme an, du hast dich verlesen?
mpm_event steht im Konflikt und sollte deaktiviert werden. Nicht mpm_prefork. Das ist erforderlich und doch erst der Grund für den Konflikt.

Bebbi
Beiträge: 172
Registriert: 21.11.2014 23:55:14

Re: Keine Verbindung zur Datenbank

Beitrag von Bebbi » 02.06.2020 23:49:51

Ja, habe ich wohl.

Code: Alles auswählen

#  a2dismod mpm_event
Module mpm_event disabled.
To activate the new configuration, you need to run:
  systemctl restart apache2
und dann weiter:

Code: Alles auswählen

#  systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
Ausgabe für: "systemctl status apache2.service"
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:
Active: failed (Result: exit-code) since Tue 2020-06-02 23:36:47 CEST; 27s ag
Docs: https://httpd.apache.org/docs/2.4/
Process: 4527 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILU

Jun 02 23:36:47 cubieboard2 systemd[1]: Starting The Apache HTTP Server...
Jun 02 23:36:47 cubieboard2 apachectl[4527]: AH00534: apache2: Configuration err
Jun 02 23:36:47 cubieboard2 apachectl[4527]: Action 'start' failed.
Jun 02 23:36:47 cubieboard2 apachectl[4527]: The Apache error log may have more
Jun 02 23:36:47 cubieboard2 systemd[1]: apache2.service: Control process exited,
Jun 02 23:36:47 cubieboard2 systemd[1]: apache2.service: Failed with result 'exi
Jun 02 23:36:47 cubieboard2 systemd[1]: Failed to start The Apache HTTP Server.
lines 1-13/13 (END)...skipping...
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-06-02 23:36:47 CEST; 27s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 4527 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Jun 02 23:36:47 cubieboard2 systemd[1]: Starting The Apache HTTP Server...
Jun 02 23:36:47 cubieboard2 apachectl[4527]: AH00534: apache2: Configuration error: No MPM loaded.
Jun 02 23:36:47 cubieboard2 apachectl[4527]: Action 'start' failed.
Jun 02 23:36:47 cubieboard2 apachectl[4527]: The Apache error log may have more information.
Jun 02 23:36:47 cubieboard2 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jun 02 23:36:47 cubieboard2 systemd[1]: apache2.service: Failed with result 'exit-code'.
Jun 02 23:36:47 cubieboard2 systemd[1]: Failed to start The Apache HTTP Server.
Ausgabe für journalctl -xe
Jun 02 23:36:47 cubieboard2 apachectl[4527]: Action 'start' failed.
Jun 02 23:36:47 cubieboard2 apachectl[4527]: The Apache error log may have more information.
Jun 02 23:36:47 cubieboard2 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit apache2.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Jun 02 23:36:47 cubieboard2 systemd[1]: apache2.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Jun 02 23:36:47 cubieboard2 systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: A start job for unit apache2.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit apache2.service has finished with a failure.
--
-- The job identifier is 1840 and the job result is failed.
Jun 02 23:39:01 cubieboard2 CRON[4536]: pam_unix(cron:session): session opened for user root by (uid=0)
Jun 02 23:39:01 cubieboard2 CRON[4537]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Jun 02 23:39:01 cubieboard2 CRON[4536]: pam_unix(cron:session): session closed for user root
Jun 02 23:39:04 cubieboard2 systemd[1]: Starting Clean php session files...
-- Subject: A start job for unit phpsessionclean.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit phpsessionclean.service has begun execution.
--
-- The job identifier is 1902.
Jun 02 23:39:05 cubieboard2 systemd[1]: phpsessionclean.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit phpsessionclean.service has successfully entered the 'dead' state.
Jun 02 23:39:05 cubieboard2 systemd[1]: Started Clean php session files.
-- Subject: A start job for unit phpsessionclean.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit phpsessionclean.service has finished successfully.
--
-- The job identifier is 1902.
" Failed to start The Apache HTTP Server" sollte auf ein Problem hinweisen.

Dazu wurde andernorts hier vorgeschlagen:

Code: Alles auswählen

 netstat -pltn
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1180/mysqld
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1074/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      1074/sshd
Viell läuft da also nicht, was dazwischen funken könnte.

In /var/log/apache2/error.log steht:
[Tue Jun 02 21:01:07.817496 2020] [mpm_event:notice] [pid 1121:tid 3069492656] AH00491: caught SIGTERM, shutting down
[Tue Jun 02 21:01:08.096796 2020] [mpm_event:notice] [pid 3814:tid 3069676976] AH00489: Apache/2.4.38 (Debian) configured -- resuming normal operations
[Tue Jun 02 21:01:08.097583 2020] [core:notice] [pid 3814:tid 3069676976] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jun 02 23:36:47.185989 2020] [mpm_event:notice] [pid 3814:tid 3069676976] AH00491: caught SIGTERM, shutting down
Grüße

Bebbi

Antworten