Skip to content

wp cli not working in 6.7.2 image because of php path #69

Open
@nbsoftware

Description

@nbsoftware

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions