# yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm # yum install -y yum-utils # yum-config-manager --enable remi # yum install -y php74-php-{opcache,pecl-apcu,pecl-memcached,cli,gd,mbstring,mcrypt,mysqlnd,pdo,xml} # yum install -y php74-php-fpm # vi /etc/opt/remi/php74/php-fpm.d/www.conf (以下を変更する) listen = /var/run/php-fpm/php-fpm.sock listen.owner = apache listen.group = apache listen.mode = 0660 # mkdir /var/run/php-fpm (pid用) # vi /etc/opt/remi/php74/php.ini date.timezone = Asia/Tokyo(timezone以下は任意) memory_limit = 256M upload_max_filesize = 128M max_file_uploads = 2000 max_input_vars = 20000 # vi /etc/httpd/conf.d/vhost.conf ProxyTimeout 300 <VirtualHost *:80> ServerName php74.genesis.ne.jp DocumentRoot /var/www/html/php74 <FilesMatch \.php$> SetHandler proxy:unix:/var/run/php-fpm/php-fpm.sock|fcgi://localhost </FilesMatch> </VirtualHost> # systemctl start php74-php-fpm # systemctl enable php74-php-fpm # systemctl reload httpd 普通にアクセスすればPHP5が起動、virtual HOSTとして登録したものはPHP7が起動する。
PHP5、PHP7の共存