php - 如何在 WordPress 中将 PHP 版本从 5.4.16 更新到 5.6.20 或更高版本

标签 php linux wordpress

我有 Centos 7.7。我托管我的网站的服务器。我尝试从 CLI 更新 PHP 版本,但 WordPress 上没有任何变化:

"You cannot update because WordPress 5.2.4 requires PHP version 5.6.20 or higher. You are running version 5.4.16."

# 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

# httpd -M [Fri Nov 15 13:57:00.257580 2019] [so:warn] [pid 14807] AH01574:模块 rewrite_module 已加载,正在跳过 加载的模块: 核心模块(静态) so_模块(静态) http_模块(静态) 重写模块(共享) access_compat_module(共享) actions_module(共享) 别名模块(共享) 允许方法模块(共享) auth_basic_module(共享) auth_digest_module(共享) authn_anon_module(共享) authn_core_module(共享) authn_dbd_module(共享) authn_dbm_module(共享) authn_file_module(共享) authn_socache_module(共享) authz_core_module(共享) authz_dbd_module(共享) authz_dbm_module(共享) authz_groupfile_module(共享) authz_host_module(共享) authz_owner_module(共享) authz_user_module(共享) autoindex_module(共享) 缓存模块(共享) 缓存磁盘模块(共享) 数据模块(共享) dbd_module(共享) deflate_module(共享) dir_module(共享) dumpio_module(共享) echo_module(共享) env_module(共享) expires_module(共享) ext_filter_module(共享) 过滤模块(共享) headers_module(共享) include_module(共享) info_module(共享) log_config_module(共享) logio_module(共享) mime_magic_module(共享) mime_module(共享) 协商模块(共享) Remoteip_module(共享) reqtimeout_module(共享) setenvif_module(共享) slotmem_plain_module(共享) slotmem_shm_module(共享) socache_dbm_module(共享) socache_memcache_module(共享) socache_shmcb_module(共享) 状态模块(共享) 替代模块(共享) suexec_module(共享) unique_id_module(共享) unixd_module(共享) userdir_module(共享) 版本模块(共享) vhost_alias_module(共享) dav_module(共享) dav_fs_module(共享) dav_lock_module(共享) lua_module(共享) mpm_prefork_module(共享) proxy_module(共享) lbmethod_bybusyness_module(共享) lbmethod_byrequests_module(共享) lbmethod_bytraffic_module(共享) lbmethod_heartbeat_module(共享) proxy_ajp_module(共享) proxy_balancer_module(共享) proxy_connect_module(共享) proxy_express_module(共享) proxy_fcgi_module(共享) proxy_fdpass_module(共享) proxy_ftp_module(共享) proxy_http_module(共享) proxy_scgi_module(共享) proxy_wstunnel_module(共享) ssl_module(共享) systemd_module(共享) cgi_模块(共享) ldap_模块(共享) authnz_ldap_module(共享) php5_module(共享)

enter image description here

我没有 cPanel,我需要找到一种直接从服务器更新的方法。 另外,我使用的是 Apache,不是共享主机。 谢谢。

最佳答案

我刚刚解决了我的问题,我在/etc/httpd/conf.d/10-php.conf.off 中重命名了文件/etc/httpd/conf.d/10-php.conf 并复制了/opt/rh/httpd24/root/etc/httpd/conf.modules.d/rh-php71-php.conf/etc/httpd/conf.modules.d/。并重新启动https服务。 还是谢谢了

关于php - 如何在 WordPress 中将 PHP 版本从 5.4.16 更新到 5.6.20 或更高版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58787250/

相关文章:

css - X 主题部分图像背景在大于 1300 像素宽度的屏幕尺寸中看起来不完整

php - MySql 位列在 PHP 7.1 中返回奇怪的大数(在以前的版本中没有)

python - ModuleNotFoundError : No module named 'tkinter' /PyCharm

linux - 在 Debian Jessie 上安装 ROS Kinetic

python - 用于 Node 模块和 python 要求的 Docker 缓存

php - 是否可以扩展 woocommerce 产品休息端点?

php - 如何验证名称字段以避免数字

php - 推送通知角标(Badge)计数未在 iOS 上更新

php - 在应用程序和聊天服务器(Symfony 和 Memcache)之间共享 session

wordpress - WooCommerce 显示自定义列