КОИНС.Студия - Статьи - Инсталляция и настройка программ - php - Upgrade PHP 7.1 to PHP 7.2 (Amazon Linux)

Upgrade PHP 7.1 to PHP 7.2 (Amazon Linux)

  • http://doc.workerman.net/install/install.html
    Incude this in the inscrution.

  • Uninstall old versions:
    yum remove php71 php71-php-cli php71-php-fpm php71-php-common php71-cli php71-common

  • Upgrade software:
    yum update

  • Install packages:
    yum install php72 php72-php-bcmath php72-php-devel php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-opcache php72-php-pear php72-php-pecl-apcu php72-php-pecl-memcached php72-php-pecl-ssh2 php72-php-pecl-zip php72-php-process php72-php-soap php72-php-tidy php72-php-xml php72-php-pecl-sync php72-php-pgsql php72-php-intl

    Not installed: php72-php-mcrypt

  • /etc/opt/remi/php72/php.ini
    max_input_time=600
    memory_limit=1024M
    error_reporting=E_ALL
    display_errors=off
    display_startup_errors=off
    log_errors=on
    html_errors=off
    post_max_size=64M
    upload_max_filesize=64M
    allow_url_fopen=on
    expose_php=Off

  • /etc/opt/remi/php72/php.d/40-apcu.ini
    extension=apc.so
    apc.shm_size=512M
    apc.entries_hint=524288
    apc.ttl=60
    apc.gc_ttl=600
    ; apc.mmap_file_mask=

  • /etc/opt/remi/php72/php.d/10-opcache.ini
    opache.enable=1
    opcache.memory_consumption=128
    opcache.max_accelerated_files=10000
    opcache.validate_timestamps=0

  • Move
    /etc/opt/remi/php72/php-fpm.d/www.conf
    to
    /etc/opt/remi/php72/php-fpm.default.conf
    Edit it:
    Remove definition of pool name.
    Comment out the following lines:
    ;listen = 127.0.0.1:9000
    ;php_admin_value[error_log] = /var/opt/remi/php70/log/php-fpm/www-error.log
    ;php_admin_flag[log_errors] = on

    Uncomment/change the following settings:
    security.limit_extensions=.php .html
    listen.owner=apache
    listen.group=apache
    listen.mode=0660
    pm.max_requests=500
    pm.status_path=[copy from previous version]

  • Create settings for each domain:
    /etc/opt/remi/php72/php-fpm.d/*.conf
    use
    /etc/opt/remi/php71/php-fpm.d/*.conf
    as stub. Edit all files - change path to php72 in content of the file.

  • Run PHP-FPM:
    chkconfig php72-php-fpm on
    /etc/init.d/php72-php-fpm start

  • Create symlinks:
    /opt/remi/php71/root/usr/bin/pecl -> /usr/bin/pecl
    /opt/remi/php71/root/usr/bin/php -> /usr/bin/php
    /opt/remi/php71/root/usr/bin/php-config -> /usr/bin/php-config
    /opt/remi/php71/root/usr/bin/phpize -> /usr/bin/phpize

Настройка юникс сокетов

  • /etc/opt/remi/php72/php-fpm.d/*.conf
    listen=/var/run/php-fpm/control.sock

  • Create directory:
    /var/run/php-fpm

  • /etc/httpd/vhosts.d/*.conf
    /etc/httpd/conf/default.conf
    SetHandler proxy:unix:/var/run/php-fpm/wl.sock|fcgi://localhost/
    ProxyPass unix:/var/run/php-fpm/wl.sock|fcgi://127.0.0.1/Wj0ulGMO30BR

  • /etc/httpd/conf/httpd.conf
    ThreadLimit 256
    ThreadsPerChild 128
    MaxRequestWorkers 256
    ProxyTimeout 600

  • restart php-fpm
    restart apache

Последняя модификация: 11.02.21 15:55