Richten Sie PHP-FPM auf einer LinuxMint ein
755
NaeiKinDus
Ich versuche gerade, PHP-FPM auf einem Linux Mint 18 (Sarah) zu installieren. Ich habe versucht, dies stundenlang zur Arbeit zu bringen, wenn nicht Tage, ohne Erfolg.
Das PHP-FPM scheint nicht aufgerufen zu werden, da ich beim Abfragen einer Seite immer den PHP-Code bekomme, anstatt die erwartete Webseite zu erhalten, dh .:
Abfrage:
GET /phpinfo.php
Antwort:
<?php phpinfo();
Erwartet:
phpinfo() PHP Version => 7.0.8-0ubuntu0.16.04.3 System => Linux[...]
Ein weiterer "Hinweis", dass PHP-FPM nicht aufgerufen wird, ist, dass die Antwort auf die Webseite dieselbe ist, auch wenn ich sie anhalte.
Danke für jede Hilfe!
Hier sind die Spezifikationen:
- Linux Mint 18
- Apache 2.4.18
- PHP 7 (installiert mit apt-get)
- PHP-FPM (mit apt-get)
- libapache2-mod-fastcgi
Mods aktiviert:
access_compat.load actions.conf actions.load alias.conf alias.load auth_basic.load authn_core.load authn_file.load authz_core.load authz_host.load authz_user.load autoindex.conf autoindex.load deflate.conf deflate.load dir.conf dir.load env.load fastcgi.conf fastcgi.load filter.load mime.conf mime.load mpm_event.conf mpm_event.load negotiation.conf negotiation.load rewrite.load setenvif.conf setenvif.load status.conf status.load
Inhalt des VirtualHost (nur einer aktiviert):
<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 ServerName some.server.name ServerAdmin webmaster@localhost DocumentRoot /opt/git/NetDev/NetworkWebsite/web ErrorLog $/error.log CustomLog $/access.log combined <Directory /opt/git/NetDev/NetworkWebsite/web> Options FollowSymlinks DirectoryIndex app_dev.php AllowOverride All Require all granted </Directory> # 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>
Inhalt der fastcgi.conf-Datei:
<IfModule mod_fastcgi.c> AddHandler fastcgi-script .fcgi #FastCgiWrapper /usr/lib/apache2/suexec FastCgiIpcDir /var/lib/apache2/fastcgi </IfModule>
Inhalt der Datei php7.0-fpm.conf (geladen):
# Redirect to local php-fpm if mod_php is not available <IfModule !mod_php7.c> # Enable http authorization headers SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 <FilesMatch ".+\.ph(p[3457]?|t|tml)$"> SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost" </FilesMatch> <FilesMatch ".+\.phps$"> # Deny access to raw php sources by default # To re-enable it's recommended to enable access to the files # only in specific virtual host or directory Require all denied </FilesMatch> # Deny access to files without filename (e.g. '.php') <FilesMatch "^\.ph(p[3457]?|t|tml|ps)$"> Require all denied </FilesMatch> </IfModule> <IfModule mod_fastcgi.c> AddHandler php7-fcgi .php Action php7-fcgi /php7-fcgi Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php/php7.0-fpm.sock -pass-header Authorization </IfModule>
Ich habe mehrere virtuelle Hosts auf Apache-2.4 eingerichtet. Es ist nicht gut, diese Konfiguration auf allen virtuellen Hosts hinzuzufügen. Können wir alle virtuellen Hosts einrichten?
Nullpointer vor 6 Jahren
0
@Nullpointer Sie möchten lieber eine neue Frage erstellen, anstatt eine nicht verwandte Frage zu posten.
NaeiKinDus vor 6 Jahren
0
0 Antworten auf die Frage
Verwandte Probleme
-
4
Gutes freies Ubuntu Server-VMWare-Image benötigt
-
1
Apache Reverse Proxy
-
3
Ubuntu Server mit GNOME Desktop Envinronment - Einstellen der Apatche-Konfigurationsdateiberechtigun...
-
1
Computer wird stummgeschaltet (ubunutu + Xfce)
-
8
Wie kann ich allen Benutzern in Linux Schreibzugriff auf einen Ordner gewähren?
-
5
Gibt es einen * guten * HTML-Modus für Emacs?
-
2
So deaktivieren Sie IPv6 in Linux Mint
-
3
Langsames wlan0 im Vergleich zu eth0?
-
1
Apache2-Fehlerprotokoll
-
4
Überprüfen, welche PHP-Version ich unter Linux laufe?