nginx - Upgrading PHP to 5.5.9 -
there open-source project want install on server, grav, requires php 5.5.9. have php 5.4.16 installed on centos 7 server running on nginx. actually, php-fpm. question easiest , cleanest way achieve this? have read many articles online regarding , each 1 seems have different approach such uninstalling current version of php , reinstalling scratch. or suggestions accomplish task appreciated.
in order more modern version of php need use alternative repo. there few out there choose from, have traditionally packaged newer version of lamp stack components, remi, centos7 vagrant i'm using, went webtatic.
you should follow instructions setting alternative repo yum. involves:
rpm -uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
once installed yum search php
, you'll find php versions 5.5, 5.6, 7.0 , 7.1 choose from.
instead of yum install php you're going yum install php56w
.
for example on vm, have php:
[vagrant@localhost:~]$ rpm -qa | grep php php56w-5.6.31-1.w7.x86_64 php56w-process-5.6.31-1.w7.x86_64 php56w-opcache-5.6.31-1.w7.x86_64 php56w-xml-5.6.31-1.w7.x86_64 php56w-pear-1.10.4-1.w7.noarch php56w-common-5.6.31-1.w7.x86_64 php56w-cli-5.6.31-1.w7.x86_64 php56w-mbstring-5.6.31-1.w7.x86_64 php56w-pdo-5.6.31-1.w7.x86_64 php56w-mysqlnd-5.6.31-1.w7.x86_64 php56w-fpm-5.6.31-1.w7.x86_64 php56w-gd-5.6.31-1.w7.x86_64
you need uninstall current php version, involved operation, , want have done dry run, , confident know you're doing.
as confidence won't break, vagrant/virtualbox/docker etc., there no excuse not testing out in vm first.
not mention these foundation tech state of art development these days.
here's quick , simple vagrantfile vanilla centos7 box can have , running (assuming vagrant installed , working).
# -*- mode: ruby -*- # vi: set ft=ruby : # vagrant configuration done below. "2" in vagrant.configure # configures configuration version (we support older styles # backwards compatibility). please don't change unless know # you're doing. vagrant.configure("2") |config| # common configuration options documented , commented below. # complete reference, please see online documentation @ # https://docs.vagrantup.com. # every vagrant development environment requires box. can search # boxes @ https://atlas.hashicorp.com/search. config.vm.box = "centos/7" # disable automatic box update checking. if disable this, # boxes checked updates when user runs # `vagrant box outdated`. not recommended. # config.vm.box_check_update = false # create forwarded port mapping allows access specific port # within machine port on host machine. in example below, # accessing "localhost:8080" access port 80 on guest machine. # note: enable public access opened port # config.vm.network "forwarded_port", guest: 8080, host: 8080 # config.vm.network "forwarded_port", guest: 80, host: 80 # config.vm.network "forwarded_port", guest: 3306, host: 3306 # create forwarded port mapping allows access specific port # within machine port on host machine , allow access # via 127.0.0.1 disable public access config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" # create private network, allows host-only access machine # using specific ip. config.vm.network "private_network", ip: "192.168.20.20" # create public network, matched bridged network. # bridged networks make machine appear physical device on # network. # config.vm.network "public_network" # share additional folder guest vm. first argument # path on host actual folder. second argument # path on guest mount folder. , optional third # argument set of non-required options. config.vm.synced_folder "./data", "/vagrant_data" # provider-specific configuration can fine-tune various # backing providers vagrant. these expose provider-specific options. # example virtualbox: # # config.vm.provider "virtualbox" |vb| # # display virtualbox gui when booting machine # vb.gui = true # # # customize amount of memory on vm: # vb.memory = "1024" # end # # view documentation provider using more # information on available options. # define vagrant push strategy pushing atlas. other push strategies # such ftp , heroku available. see documentation @ # https://docs.vagrantup.com/v2/push/atlas.html more information. # config.push.define "atlas" |push| # push.app = "your_atlas_username/your_application_name" # end # enable provisioning shell script. additional provisioners such # puppet, chef, ansible, salt, , docker available. please see # documentation more information specific syntax , use. # config.vm.provision "shell", inline: <<-shell # apt-get update # apt-get install -y apache2 # shell end
Comments
Post a Comment