Outils pour utilisateurs

Outils du site


linux:php7fpm-debian8

Ceci est une ancienne révision du document !


php7.0-fpm sur Debian 8

PHP 7 n'est pas disponible par défaut sur Debian8. Il faut donc ajouter le dépôt “dotdeb” qui permet de l'installer. Le but est d'utiliser php5-fpm et php7.0-fpm en simultané.

Dépôt dotdeb

Créer le fichier /etc/apt/sources.list.d/dotdeb.list et ajouter le contenu suivant :

deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all

Et saisir les commandes suivantes :

wget https://www.dotdeb.org/dotdeb.gpg
apt-key add dotdeb.gpg
apt update

Installation des packages

apt install php7.0-fpm php7.0 php7.0-sqlite php7.0-mysql php7.0-gd php7.0-curl php7.0-xml php7.0-zip php7.0-mbstring

Configuration

post_max_size = 20M
upload_max_filesize = 20M
max_execution_time = 60
memory_limit = 128M

; configuration for php ZendOpcache module
; priority=05
zend_extension=opcache.so
opcache.memory_consumption = 128
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 4000
opcache.revalidate_freq = 10
opcache.fast_shutdown=1

pm = ondemand
pm.max_children = 20
pm.process_idle_timeout = 15s

Pensez à relancer php7.0-fpm :

service php7.0-fpm restart

Vhost

<Directory /usr/lib/cgi-bin>
        Require all granted
</Directory>

<IfModule mod_fastcgi.c>
    AddHandler php-fcgi .php
    Action php-fcgi /php-fcgi-domain.info
    Alias /php-fcgi-domain.info /usr/lib/cgi-bin/php-fcgi-domain.info
    FastCgiExternalServer /usr/lib/cgi-bin/php-fcgi-domain.info -socket /var/run/php/php7.0-fpm.sock -pass-header Authorization -idle-timeout 3600
</IfModule>

Pour changer de version de php utilisée, il suffit de pointer dans le vhost sur le bon socket php-fpm.

Ceci n'est qu'un extrait du fichier vhost, concernant php7.0-fpm. Pour plus d'infos, voir comment installer un serveur web.

Solutions compatibles php7.0

Liste non exhaustive de mes tests sur php7.0, validés :

linux/php7fpm-debian8.1467146022.txt.gz · Dernière modification : 2020/07/24 22:03 (modification externe)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki