We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
New design
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

4.4.4. Updating PHP on CentOS

Attention!

The actions indicated in this article are purely advisory in nature, before performing any actions it is recommended create a backup VPS.

To update PHP, you need to connect to the server using SSH and first of all connect the repository by running the commands:
yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

After connecting the repository, run the command:

php -v
  • If the result displays text like “php: command not found", Then install the new PHP version by running the command:
    yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring 
  • If the result displays text like “PHP 5.X.XX (cli)»Or similar, remove the old PHP version and install the new one:
    1. Remove the old PHP version with the command:
      yum remove php-common
    2. Install the new PHP version with the command:
      yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring
    3. If any packages have not been replaced with new ones, you can run the commands:
      yum install yum-plugin-replace
      yum replace php-common --replace-with=php56w-common
To update PHP, you need to connect to the server using SSH and first of all connect the repository by running the commands:
yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

After connecting the repository, run the command:

php -v
  • If the result displays text like “php: command not found", Then install the new PHP version by running the command:
    yum install -y php70w php70w-opcache php70w-xml php70w-mcrypt php70w-gd php70w-devel php70w-mysql php70w-intl php70w-mbstring 
  • If the result displays text like “PHP 5.X.XX (cli)»Or similar, remove the old PHP version and install the new one:
    1. Remove the old PHP version with the command:
      yum remove php-common
    2. Install the new PHP version with the command:
      yum install -y php70w php70w-opcache php70w-xml php70w-mcrypt php70w-gd php70w-devel php70w-mysql php70w-intl php70w-mbstring
    3. If any packages have not been replaced with new ones, you can run the commands:
      yum install yum-plugin-replace
      yum replace php-common --replace-with=php70w-common