cd /usr/src
wget http://au1.php.net/get/php-7.2.13.tar.gz/from/this/mirror
mv mirror php-7.2.13.tar.gz
tar -xvzf php-7.2.13.tar.gz
cd php-7.2.13
mkdir -p /opt/php/php-7.2.13
nano configure.sh
#!/bin/bash
./configure \
--prefix=/opt/php/php-7.2.13 \
--with-config-file-path=/opt/php-7.0.26/etc
--enable-shared \
--enable-mbstring \
--with-curl \
--with-gd \
--with-zlib \
--enable-bcmath \
--with-xmlrpc \
--with-xsl \
--with-pgsql \
--with-pdo-pgsql \
--enable-ctype \
--with-openssl \
--with-bz2 \
--enable-fpm \
--with-fpm-user=zital \
--with-fpm-group=zital
bash configure.sh
CPU-en arabera:
make -j2
cp /usr/src/php-7.2.13/php.ini-development /opt/php/php-7.2.13/etc/php.ini
echo "include_path = \"/opt/php/php-7.2.13/lib/php\"" >> /opt/php/php-7.2.13/etc/php.ini
cp /opt/php/php-7.2.13/etc/php-fpm.conf.default /opt/php/php-7.2.13/etc/php-fpm.conf
cp /opt/php/php-7.2.13/etc/php-fpm.d/www.conf.default /opt/php/php-7.2.13/etc/php-fpm.d/www.conf
nano /opt/php/php-7.2.13/etc/php-fpm.d/www.conf
;...
listen = /run/php-fpm/php7.2-fpm.sock
;...
listen.owner = zital
listen.group = zital
listen.mode = 0660
;...
catch_workers_output = yes
;...
nano /etc/systemd/system/php7.2-fpm.service
[Unit]
Description=The PHP FastCGI Process Manager
After=network.target
[Service]
Type=simple
PIDFile=/run/php-fpm/php7.2-fpm.pid
ExecStart=/opt/php/php-7.2.13/sbin/php-fpm --nodaemonize --fpm-config /opt/php/php-7.2.13/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
mkdir -p /run/php-fpm/
systemctl status php7.2-fpm
systemctl start php7.2-fpm
systemctl status php7.2-fpm
# systemctl enable php7.2-fpm
# apache martxan badakozun amata
/etc/init.d/apache2 stop
apt-get install nginx
nano /etc/nginx/nginx.conf
user zital zital;
nano /etc/nginx/sites-available/default
# eskerrak @urtzai
upstream php_upstream {
server unix:/run/php-fpm/php7.2-fpm.sock;
}
server {
listen 80;
listen [::]:80;
server_name localhost;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
root /home/project/public;
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log /var/log/nginx/project-access.log;
error_log /var/log/nginx/project-error.log;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass php_upstream;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Eskerrak @urtzai eta hau idatzi dauienari:
https://www.howtoforge.com/how-to-build-php-5.6-fpm-fastcgi-with-zend-opcache-and-apcu-for-ispconfig-3-on-debian-7-wheezy