Wie einrichten von PHP 7 mit NGINX

Ich PHP installiert 7 Nightly und Nginx 1.9.7 (Mainline), die auf meine Entwicklung von Debian Stable:

$ curl http://nginx.org/keys/nginx_signing.key | apt-key add -
$ echo -e 'deb http://nginx.org/packages/mainline/debian/jessie nginx\ndeb-src http://nginx.org/packages/mainline/debian/jessie nginx' > /etc/apt/sources.list.d/nginx.list
$ echo -e 'deb http://repos.zend.com/zend-server/early-access/php7/repos ubuntu/' > /etc/apt/sources.list.d/php.list
$ apt-get -y update && time apt-get -y dist-upgrade
$ apt-get -y --force-yes install --fix-missing nginx php7-nightly
$ service nginx restart

Habe ich diese Konfigurations-Datei in /etc/nginx/conf.d/php.conf (Standard.conf auskommentiert). Es ist der ursprüngliche Standard.conf, die ich einfach auskommentiert PHP-fastCGI-Linien:

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;
        #access_log  /var/log/nginx/log/host.access.log  main;

        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            include        fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

Habe ich nicht gefunden, jedes tutorial im Netz, wie zum einrichten von Nginx Mainline mit PHP 7 noch. 🙁

Danke!

  • Wenn Sie die PHP-FPM-SAPI (FastCGI Process Manager), nginx konfiguriert ist genau das gleiche wie vorher. Mit dem FPM-SAPI ist in der Regel eine gute option, da Sie ermöglicht die Kontrolle über die php-Prozesse unabhängig von Ihrem webserver (im Vergleich mit nginx verwalten die fastcgi-Prozesse), und der php-Umgebung nicht geladen werden von Grund auf jede Anfrage (Vergleich mit regulären CGI).
  • Kennen Sie eine tutorial zum installieren von php-fpm zu php7? Gibt es eine Möglichkeit es zu installieren mit dem Paket-manager?
  • Sieht aus wie aus php 5.3.3 ist im Kern php-Paket.
InformationsquelleAutor Lanti | 2015-11-30
Schreibe einen Kommentar