Comments (14)
@porg The latest stable seems to work fine for me...
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6831k 100 6831k 0 0 34.6M 0 --:--:-- --:--:-- --:--:-- 34.7M
$ php wp-cli.phar theme status "twentytwentythree"
Theme twentytwentythree details:
Name: Twenty Twenty-Three
Status: Active
Version: 1.0 (Update available)
Author: the WordPress team
Can you share wp --info
? Maybe you have some odd PHP configuration?
from wp-cli.
This is what I get on my shared webhosting service:
$ wp --info
OS: Linux 4.19.0-22-amd64 #1 SMP Debian 4.19.260-1 (2022-09-29) x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php8.0
PHP version: 8.0.28
php.ini used: /etc/php/8.0/cli/php.ini
MySQL binary: /usr/bin/mysql
MySQL version: mysql Ver 14.14 Distrib 5.7.40-43, for debian-linux-gnu (x86_64) using 7.0
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: /data/web/customer-id
WP-CLI packages dir: /data/web/customer-id/.wp-cli/packages/
WP-CLI cache dir: /data/web/customer-id/.wp-cli/cache
WP-CLI global config: /data/web/customer-id/.wp-cli/config.yml
WP-CLI project config:
WP-CLI version: 2.10.0
from wp-cli.
My guess is that phar_safe_path()
is failing:
Lines 1462 to 1473 in e516414
Can you launch wp shell
and share the return value of WP_CLI\Utils\inside_phar()
?
from wp-cli.
=> bool(true)
from wp-cli.
Huh!
Can you try re-downloading WP-CLI? What does md5 <wp-cli-path>
give you?
from wp-cli.
md5 not available in the shell of the webhost.
In the European evening I will download the binary via SFTP and then md5 on my computer.
from wp-cli.
FYI: The current wp-cli
binary has been installed via its own update mechanism wp cli update
.
from wp-cli.
$ wp cli version
WP-CLI 2.10.0
$ wp cli check-update
Success: WP-CLI is at the latest version.
md5 = 6710e90c3ed173925acd35ce5fe5aaf9
from wp-cli.
$ wp cli update
Success: WP-CLI is at the latest version.
- There is no possibility to run
wp cli update
with a--force
flag to re-download and re-install. - I could run the curl oneliner to re-install. Shall I?
- Or shall I try the nightly?
- Could I downgrade again later?
- Is wp-cli shipped "all in one file"? (Seems so at first glance at the curl oneliner)
- So install is effectively only the download of a single file .phar file and making it executable (via shebang) or else run invoke it with
php
before it. But when running the first time, is it installing libraries or config files elsewhere? - If not, then I assume downgrading to the stable should be possible.
from wp-cli.
Is wp-cli shipped "all in one file"? (Seems so at first glance at the curl oneliner)
Yes, as a Phar file ("PHP Archive").
I could run the curl oneliner to re-install. Shall I?
Or shall I try the nightly?
Based on your md5 results, it seems you have the correct file for WP-CLI v2.10.0.
But, wp-cli/core-command#160 looks like a similar report where the user saw different results based on which URL they downloaded the Phar from.
Can you try downloading a new copy of WP-CLI using curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
and seeing if the problem reproduces with the new copy?
from wp-cli.
Generally I believe in computing to be a deterministic discipline
- … though in over 3 decades of experience I had some occasions where after all debugging was exhausted it may shortly felt as if voodoo was involved 😂.
- Your forementioned issue where a file with the same MD5 checksum produces a different outcome depending from where it was downloaded, again seems too much voodoo to me! I don't believe this to be the true cause.
- Eventually in a deterministic machine, there is always some kind of real difference, which makes the difference, which we oversee. Be it a filesystem timestamp (which strangely is involved in whatever logic), or faulty permissions which the re-download somehow corrects, or be it even an odd bug like an xattr, which kept the download URL, which as far etched as it may seem nevertheless makes a difference for some very very odd reason. Whatever insignificant bit of data or metadata it ever may be, I've experienced it all 😉
But in our case here, it is rather some PHP env/runtime difference (e.g. Object Cache which I have ON) or some faulty PHP files in WordPress Core (although I never touched them), with which wp-cli interfaces, I assume.
My conducted testing which lead to no difference yet
- In my
~/bin
I noticed filewp-completion.bash
.
- Deleted it.
- Ran
wp theme status "twentytwentythree"
again. - Same error as before.
- Logged out and into my shell again, my bash complained about a missing
wp-completion.bash
which is sourced in~/.bashrc
.
- So in this state
wp-completion.bash
was definitely not in action. - Ran
wp theme status "twentytwentythree"
again. - Same error as before.
- Downloaded via the curl-oneliner, removed the old phar file, renamed the downloaded to just
wp
.
- Ran
wp theme status "twentytwentythree"
again. - Same error as before.
- Due to having no possibility to run shebang executables in the SSH environment of my shared webhosting, in my
.bashrc
I have hadalias wp="php ~/bin/wp"
for a while now.
- Ran explicitly
php ~/bin/wp theme status "twentytwentythree"
. - Same error as before.
Any more ideas?
from wp-cli.
Please note: Personally I don't care for this bug.
- I just spotted it by coincidence in a use case which I may use only once every year or so.
- Instead of
wp theme status <specificTheme>
I can just runwp theme status
get the whole report and then look at my<specificTheme>
of interest. - But some people who may rely on that function for automation, may get a problem with it.
- Hence I took it to heart to report and take part in debugging it. But from my side my curiosity in this is done, and from myself I would not further look into this, but just accept it as is.
- If you deem this as worthy to further investigate, please tell me what I should be looking for.
from wp-cli.
Oh, it's definitely a bug, I don't deny that. I don't have any ideas what it might be.
If I was able to reproduce the issue, I'd open the Phar file in vim and add some debugging checkpoints around the code in question.
@wp-cli/committers Any ideas what the issue might be?
from wp-cli.
Related Issues (20)
- Unable to copy help output to clipboard HOT 4
- Release checklist for v2.9.1 HOT 2
- Release Checklist for WP-CLI v2.9.1 HOT 1
- WP_CLI_PHP ignored even when installing from deb not phar HOT 5
- No colorized output when returning an object from WP_CLI:runcommand() HOT 1
- PHP parse error HOT 3
- WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version HOT 8
- Owners and Permissions scheme HOT 1
- Release checklist for v2.10.0 HOT 2
- Failing tests because of `mysqldump --skip-column-statistics` arg
- PHP deprecation warnings triggered by calls to `WP_CLI::error()` and `WP_CLI::halt()` HOT 1
- PHP deprecation warning(s) triggered by `Utils\http_request()` HOT 1
- Error: Wp cli project based installation is not working in Ubuntu 22.04.3
- phar version is out-of-date HOT 4
- Docs: Improve Inline Comments
- Bug Report: wpcli Hangs When Attempting to Update Hacked WordPress Sites HOT 2
- Shipping unprefixed dependencies causes conflicts. HOT 4
- Conflict-free distribution - current state and issues that need solving HOT 2
- Wordwrapping in the tabular output HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-cli.