Default version of PHP CLI to PHP 7.0

4 posts / 0 new
Last post
#1 Sat, 05/11/2019 - 12:00
ivanbg

Default version of PHP CLI to PHP 7.0

Hello,

I have a problem. I have installed PHP 7.0 in Centos 7 in order to increase the speed of my WordPress installs. All is Ok. I follow the instruction from the Virtualmin FAQ and use Centos SCL Repository. I have installed 2 versions: 5.4.16 and 7.0.27. All works fine with the Apache server.

The problem is with the command line. I have tried to resolve:

I edit ~/.bashrc and add the following lines:

export WP_CLI_PHP='/opt/rh/rh-php70/root/usr/bin/php'

alias php='/opt/rh/rh-php70/root/usr/bin/php'

The first to use WP-CLI with PHP 7. The second to change the PHP version use in command line.

When I write PHP -v all is ok:

"PHP 7.0.27 (cli) (built: Apr 4 2018 13:48:44) ( NTS )"

But when I use WP-CLI to manage my WordPress, the script thinks that I am using the older PHP version installed in the system:

"Your server is running PHP version 5.4.16 but WordPress 5.2 requires at least 5.6.20."

What am I doing wrong?

Thank you very much.

Sun, 05/12/2019 - 05:43
irieyuusuke

I have same problem, so I am interested in this.

Sun, 07/28/2019 - 12:35
cs10

Same issue here, would love some help with this if anyone has solved it?

Thu, 08/01/2019 - 12:22
dimitrist

did you check apache/nginx configuration? which php version is server loading? php versions on these virtual servers?