I recently moved my main site to SiteGround, which has been pretty nice so far. One of the little issues I’ve had has been the same as several other hosts: not using the latest version of WP-CLI on shared hosting accounts. It’s not unusual, and often not a major problem, but I recently came across an issue that prevents me from using the version installed on the server (0.18.0) with the version of WordPress I’m running on the site (4.4 trunk). Every time I tried to use certain wp commands, I was greeted with a fun new error message:
Fatal error: Cannot redeclare class WP_Http in /home/morganes/public_html/wp-includes/class-http.php on line 21
WordPress 4.4 is undergoing some massive file changes, specifically with separating classes, functions, and implementation code into their own files and using the original file to load them all for backwards compatibility. One of those changes caused an error with WP-CLI trying to redeclare WP_Http the class when it loaded it via require instead of require_once. That’s been fixed in 0.20.0, so I asked my host to upgrade to it.
If you're running @WordPress 4.4-alpha, be sure to update @wpcli to 0.20.0. Otherwise you'll run into a PHP fatal error with WP_Http.
Since I have shared hosting, an upgrade to the script would involve upgrading it for all users. That’s something that’s done on a schedule, and I don’t know when that’ll happen. SiteGround’s systems engineering team hasn’t upgraded yet, so they suggested installing a local version of wp-cli on my account and using it. I followed the Alternative Install Methods guide but kept running into a problem with the output and strange characters. After much trial-and-error, I found out that the shared WP-CLI script uses a different version of PHP than the regular command line does. Making a couple of changes to my .bash_profile finally got the latest version working.
Here’s the final version that’s working for me with WP-CLI v0.20.1 and WordPress 4.4-alpha. I’ve decided to use wpcli as my command for testing, so I can keep SiteGround’s version of wp to know when they’ve updated.
# WP-CLI from user account
alias wpcli="$WP_CLI_PHP $HOME/.wp-cli/wp-cli.phar --path=$HOME/public_html/"
“There was a problem while playing [-22]” is the message that greeted me every time I tried to view a video in Google Play Movies & TV. I’m running CyanogenMod 12 (CM12S/Android 5.0.2) on a OnePlus One and like to test out apps, so maybe it was one of the new ones. After several hours of removing and reinstalling apps, chatting with tech support, searching for an error message that seems to be pretty rare, I hadn’t gotten very far.
Since it worked fine in safe mode, I finally bit the bullet and did a factory reset on my phone. That worked, but as soon as I restored my backup, the problem came back, but this time I noticed that I couldn’t play any videos through the default player or the Google Photos app. Another search for video player problems indicated there’s an issue with the experimental video player, and to toggle the NuPlayer/AwesomePlayer settings in the developer settings. Violà!
I’m back to watching my Shaun the Sheep videos and all is right in the world once again.