title: How to update PHP version from 5.4.16 to 5.6.20 or a newer version in Wordpress
body: <p>I have a Centos 7.7. server where I am hosting my website. I tried to update the PHP version from the CLI but nothing has changed on Wordpress:</p>
  
  <blockquote>
    <p>"You cannot update because WordPress 5.2.4 requires PHP version 5.6.20 or higher. You are running version 5.4.16."</p>
  </blockquote>
  
  <pre><code># php -v
  PHP 7.1.30 (cli) (built: Aug 21 2019 09:27:22) ( NTS )
  Copyright (c) 1997-2018 The PHP Group
  Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
  
  # rpm -qa|grep php
  rh-php71-php-json-7.1.30-1.el7.x86_64
  rh-php71-php-cli-7.1.30-1.el7.x86_64
  php-gd-5.4.16-46.1.el7_7.x86_64
  php-5.4.16-46.1.el7_7.x86_64
  php-mysql-5.4.16-46.1.el7_7.x86_64
  rh-php71-php-7.1.30-1.el7.x86_64
  rh-php71-php-zip-7.1.30-1.el7.x86_64
  php-mcrypt-5.4.16-9.el7.x86_64
  php-cli-5.4.16-46.1.el7_7.x86_64
  php-mbstring-5.4.16-46.1.el7_7.x86_64
  rh-php71-runtime-1-1.el7.x86_64
  php-common-5.4.16-46.1.el7_7.x86_64
  php-xmlrpc-5.4.16-46.1.el7_7.x86_64
  rh-php71-php-common-7.1.30-1.el7.x86_64
  php-pdo-5.4.16-46.1.el7_7.x86_64
  php-xml-5.4.16-46.1.el7_7.x86_64
  </code></pre>
  
  <p># httpd -M
  [Fri Nov 15 13:57:00.257580 2019] [so:warn] [pid 14807] AH01574: module rewrite_module is already loaded, skipping
  Loaded Modules:
   core_module (static)
   so_module (static)
   http_module (static)
   rewrite_module (shared)
   access_compat_module (shared)
   actions_module (shared)
   alias_module (shared)
   allowmethods_module (shared)
   auth_basic_module (shared)
   auth_digest_module (shared)
   authn_anon_module (shared)
   authn_core_module (shared)
   authn_dbd_module (shared)
   authn_dbm_module (shared)
   authn_file_module (shared)
   authn_socache_module (shared)
   authz_core_module (shared)
   authz_dbd_module (shared)
   authz_dbm_module (shared)
   authz_groupfile_module (shared)
   authz_host_module (shared)
   authz_owner_module (shared)
   authz_user_module (shared)
   autoindex_module (shared)
   cache_module (shared)
   cache_disk_module (shared)
   data_module (shared)
   dbd_module (shared)
   deflate_module (shared)
   dir_module (shared)
   dumpio_module (shared)
   echo_module (shared)
   env_module (shared)
   expires_module (shared)
   ext_filter_module (shared)
   filter_module (shared)
   headers_module (shared)
   include_module (shared)
   info_module (shared)
   log_config_module (shared)
   logio_module (shared)
   mime_magic_module (shared)
   mime_module (shared)
   negotiation_module (shared)
   remoteip_module (shared)
   reqtimeout_module (shared)
   setenvif_module (shared)
   slotmem_plain_module (shared)
   slotmem_shm_module (shared)
   socache_dbm_module (shared)
   socache_memcache_module (shared)
   socache_shmcb_module (shared)
   status_module (shared)
   substitute_module (shared)
   suexec_module (shared)
   unique_id_module (shared)
   unixd_module (shared)
   userdir_module (shared)
   version_module (shared)
   vhost_alias_module (shared)
   dav_module (shared)
   dav_fs_module (shared)
   dav_lock_module (shared)
   lua_module (shared)
   mpm_prefork_module (shared)
   proxy_module (shared)
   lbmethod_bybusyness_module (shared)
   lbmethod_byrequests_module (shared)
   lbmethod_bytraffic_module (shared)
   lbmethod_heartbeat_module (shared)
   proxy_ajp_module (shared)
   proxy_balancer_module (shared)
   proxy_connect_module (shared)
   proxy_express_module (shared)
   proxy_fcgi_module (shared)
   proxy_fdpass_module (shared)
   proxy_ftp_module (shared)
   proxy_http_module (shared)
   proxy_scgi_module (shared)
   proxy_wstunnel_module (shared)
   ssl_module (shared)
   systemd_module (shared)
   cgi_module (shared)
   ldap_module (shared)
   authnz_ldap_module (shared)
   php5_module (shared)</p>
  
  <p><a href="https://i.stack.imgur.com/sndiS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sndiS.png" alt="enter image description here"></a></p>
  
  <p>I don't have cPanel and I need to find a way to update directly from the server.
  Also I'm using Apache and is not a shared hosting.
  Thanks.</p>