docker-wordpress icon indicating copy to clipboard operation
docker-wordpress copied to clipboard

wp cli not working in 6.7.2 image because of php path

Open nbsoftware opened this issue 9 months ago • 1 comments

php cli is still linked to php83 although wordpress is using php84

1a377be75300:/var/www/wp-content# ls -l /usr/bin/php*
lrwxrwxrwx    1 root     root            14 Apr 24 06:40 /usr/bin/php -> /usr/bin/php83
-rwxr-xr-x    1 root     root       4790072 Mar 27 11:08 /usr/bin/php83
-rwxr-xr-x    1 root     root       4921320 Mar 15 02:16 /usr/bin/php84

You just need to issue a

RUN rm /usr/bin/php && ln -s /usr/bin/php84 /usr/bin/php

in the Dockerfile so that wp cli works again:

1a377be75300:/var/www/wp-content# wp cli info
OS:	Linux 6.10.14-linuxkit #1 SMP Thu Mar 20 16:32:56 UTC 2025 aarch64
Shell:
PHP binary:	/usr/bin/php84
PHP version:	8.4.5
php.ini used:	/etc/php84/php.ini
MySQL binary:	/usr/bin/mysql
MySQL version:	mysql from 11.4.5-MariaDB, client 15.2 for Linux (aarch64) using readline 5.1
SQL modes:
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/var/www/wp-content
WP-CLI packages dir:
WP-CLI cache dir:	/root/.wp-cli/cache
WP-CLI global config:	/usr/src/wordpress/wp-cli.yml
WP-CLI project config:
WP-CLI version:	2.11.0

nbsoftware avatar Apr 24 '25 06:04 nbsoftware

Hi @nbsoftware ,

This shouldn't be the case. Can you paste your Dockerfile? And do you also experience this in 6.8.1?

TrafeX avatar May 18 '25 14:05 TrafeX