# \#wp-cli

**URL:** https://community.localwp.com/tag/wp-cli/48.md

[Latest](https://community.localwp.com/latest.md) · [Categories](https://community.localwp.com/categories.md) · [Tags](https://community.localwp.com/tags.md)

---

## [Lots of new errors creating new site](https://community.localwp.com/t/lots-of-new-errors-creating-new-site/52482)

<div class="topic-metadata">

**Author:** [@TonyGman](https://community.localwp.com/u/TonyGman)\
**Replies:** 2\
**Last updated:** [August 12, 2026, 1:59pm UTC](https://community.localwp.com/t/lots-of-new-errors-creating-new-site/52482 "2026-08-12T13:59:33Z")

</div>

I’ve been happily using Local for years, with the latest versions on this Windows 11, and no recent issues. However, Local 10.1.1+6939 now seems to be grumpy about creating new sites. I’m trying to diagnose this but hopi…

---

## [Site shell wp db cli connecting to wrong port](https://community.localwp.com/t/site-shell-wp-db-cli-connecting-to-wrong-port/47331)

<div class="topic-metadata">

**Author:** [@jimihenrik](https://community.localwp.com/u/jimihenrik)\
**Replies:** 7\
**Last updated:** [March 17, 2026, 10:18am UTC](https://community.localwp.com/t/site-shell-wp-db-cli-connecting-to-wrong-port/47331 "2026-03-17T10:18:39Z")

</div>

What issue or error are you experiencing? wp db cli in the public folder doesn’t work without editing WP-config Other wp db have similar problems but that doesn’t really matter for the problem itself. If this is the ex…

---

## [Local 7.2.0 and WP-CLI](https://community.localwp.com/t/local-7-2-0-and-wp-cli/39023)

<div class="topic-metadata">

**Author:** [@emmtre](https://community.localwp.com/u/emmtre)\
**Replies:** 16\
**Last updated:** [March 2, 2026, 8:41am UTC](https://community.localwp.com/t/local-7-2-0-and-wp-cli/39023 "2026-03-02T08:41:44Z")

</div>

@austinwendt @adamperry Here we go again… The bundled WP-CLI version in Local 7.2.0 is still 2.7.1 but since the preferred PHP version 8.1.22 is copied now to the Application Support folder you can’t update WP-CLI with…

---

## [Export sites from command line](https://community.localwp.com/t/export-sites-from-command-line/51676)

<div class="topic-metadata">

**Author:** [@rahul\_local](https://community.localwp.com/u/rahul_local)\
**Replies:** 5\
**Last updated:** [December 11, 2025, 2:12pm UTC](https://community.localwp.com/t/export-sites-from-command-line/51676 "2025-12-11T14:12:37Z")

</div>

Hi, I would like to know how to export sites from command line. I have looked at the exported zip files and looks like the export is doing these actions: Take mysqldump of the database to path-to-site/app/sql/local.sql …

---

## [Unable to run some wp-cli DB commands](https://community.localwp.com/t/unable-to-run-some-wp-cli-db-commands/26920)

<div class="topic-metadata">

**Author:** [@janw.me](https://community.localwp.com/u/janw.me)\
**Replies:** 4\
**Last updated:** [September 28, 2021, 3:26pm UTC](https://community.localwp.com/t/unable-to-run-some-wp-cli-db-commands/26920 "2021-09-28T15:26:14Z")

</div>

Issue Summary Some wp db \*\* commands don’t work some do. Replication When I start any site, right click open site shell and execute: Works: wp db check wp db export (it was a problem in the past apparently) Gives er…

---

## [@mac os trying to get ssl for local site](https://community.localwp.com/t/mac-os-trying-to-get-ssl-for-local-site/47169)

<div class="topic-metadata">

**Author:** [@bles](https://community.localwp.com/u/bles)\
**Replies:** 3\
**Last updated:** [February 26, 2025, 2:48pm UTC](https://community.localwp.com/t/mac-os-trying-to-get-ssl-for-local-site/47169 "2025-02-26T14:48:40Z")

</div>

I’m trying to get https version of my site with local. I’m using an old version of local Version 9.0.5+6706 at mac os ( big sur). I followed localwp’s helpdoc with respect to getting ssl certificate on mac os for the …

---

## [Keep WP CLI updated](https://community.localwp.com/t/keep-wp-cli-updated/46367)

<div class="topic-metadata">

**Author:** [@Surbma](https://community.localwp.com/u/Surbma)\
**Replies:** 2\
**Last updated:** [January 9, 2025, 5:04pm UTC](https://community.localwp.com/t/keep-wp-cli-updated/46367 "2025-01-09T17:04:33Z")

</div>

Hi, please keep the WP-CLI updated! The current version is 2.10.0 in Local WP, however the latest version is 2.11.0, which was released in Aug 8, 2024. My problem is that it has an older version of the i18n-command, th…

---

## [Clicking any Local Sites launches "cli.js" in VSCODE](https://community.localwp.com/t/clicking-any-local-sites-launches-cli-js-in-vscode/45520)

<div class="topic-metadata">

**Author:** [@CodeSlayer2010](https://community.localwp.com/u/CodeSlayer2010)\
**Replies:** 2\
**Last updated:** [November 14, 2024, 2:03pm UTC](https://community.localwp.com/t/clicking-any-local-sites-launches-cli-js-in-vscode/45520 "2024-11-14T14:03:01Z")

</div>

What issue or error are you experiencing? Suddenly, as of about a week ago, whenever I click any of the sites in the “Local sites” sidebar, it launches a VSCode Windows 11 permission dialog, and when I click “Yes”, then V…

---

## [Set up new cron job using WP CLI in local](https://community.localwp.com/t/set-up-new-cron-job-using-wp-cli-in-local/45268)

<div class="topic-metadata">

**Author:** [@CBooth](https://community.localwp.com/u/CBooth)\
**Replies:** 7\
**Last updated:** [November 4, 2024, 2:06pm UTC](https://community.localwp.com/t/set-up-new-cron-job-using-wp-cli-in-local/45268 "2024-11-04T14:06:25Z")

</div>

I am trying to set up new Cron job for CiviCRM using WP CLI command line in the Local Shell The instructions from CiviCRM are as follows: $ /path/to/wp-cli –user=cronuser –url=http://example.org –path=/var/www/exa…

---

## [Site shell not working, "Did you mean 'db'?"](https://community.localwp.com/t/site-shell-not-working-did-you-mean-db/44832)

<div class="topic-metadata">

**Author:** [@HG3000](https://community.localwp.com/u/HG3000)\
**Replies:** 15\
**Last updated:** [October 18, 2024, 12:54pm UTC](https://community.localwp.com/t/site-shell-not-working-did-you-mean-db/44832 "2024-10-18T12:54:37Z")

</div>

Trying to use the Site shell / WP CLI form the WP local app results in a console windows with errors and no shell. Trying to open WP Shell from the terminal in VSCode gives me a mysqli\_real\_connect error, but I found tha…

---

## [WP-cli 2.10.0 (GitHub PR help wanted)](https://community.localwp.com/t/wp-cli-2-10-0-github-pr-help-wanted/41386)

<div class="topic-metadata">

**Author:** [@emmtre](https://community.localwp.com/u/emmtre)\
**Replies:** 5\
**Last updated:** [August 8, 2024, 7:24am UTC](https://community.localwp.com/t/wp-cli-2-10-0-github-pr-help-wanted/41386 "2024-08-08T07:24:21Z")

</div>

@ben.turner Why wasn’t your pull request included in the lastest WP-CLI release?

---

## [Error codes using WP CLI](https://community.localwp.com/t/error-codes-using-wp-cli/43064)

<div class="topic-metadata">

**Author:** [@djave](https://community.localwp.com/u/djave)\
**Replies:** 6\
**Last updated:** [May 29, 2024, 1:31pm UTC](https://community.localwp.com/t/error-codes-using-wp-cli/43064 "2024-05-29T13:31:08Z")

</div>

Bug Summary When I run any wp cli command, I get two errors. I am using PHP 8.3.0 on an Apple M1 Pro. Failed loading /Users/djave\_co/Library/Application Support/Local/lightning-services/php-8.3.0+1/bin/darwin-arm64/lib…

---

## [Site shell error](https://community.localwp.com/t/site-shell-error/42536)

<div class="topic-metadata">

**Author:** [@ProgramadorWP](https://community.localwp.com/u/ProgramadorWP)\
**Replies:** 2\
**Last updated:** [April 24, 2024, 9:48pm UTC](https://community.localwp.com/t/site-shell-error/42536 "2024-04-24T21:48:46Z")

</div>

What issue or error are you experiencing? Warning: PHP Startup: Unable to load dynamic library ‘php\_imagick.dll’ (tried: C:/Users/Rafa Carvalhido/AppData/Roaming/Local/lightning-services/php-8.1.23+0/bin/win64/ext\\php\_im…

---

## [Local site shell not working properly](https://community.localwp.com/t/local-site-shell-not-working-properly/42496)

<div class="topic-metadata">

**Author:** [@ProgramadorWP](https://community.localwp.com/u/ProgramadorWP)\
**Replies:** 4\
**Last updated:** [April 24, 2024, 1:02am UTC](https://community.localwp.com/t/local-site-shell-not-working-properly/42496 "2024-04-24T01:02:53Z")

</div>

What issue or error are you experiencing? After I run a wp-cli command such as wp db export database.sql, it says ‘grep’ is not recognized as internal or external command. Warning: Failed to get current character set of …

---

## [Error: Cannot connect to MySQL server on 'localhost' during wp db import in Local Site Shell](https://community.localwp.com/t/error-cannot-connect-to-mysql-server-on-localhost-during-wp-db-import-in-local-site-shell/42302)

<div class="topic-metadata">

**Author:** [@farhan](https://community.localwp.com/u/farhan)\
**Replies:** 1\
**Last updated:** [April 9, 2024, 1:38pm UTC](https://community.localwp.com/t/error-cannot-connect-to-mysql-server-on-localhost-during-wp-db-import-in-local-site-shell/42302 "2024-04-09T13:38:29Z")

</div>

---

## [M1 Mac loading X86 libraries - local lightning (opcache, xdebug, imagick)](https://community.localwp.com/t/m1-mac-loading-x86-libraries-local-lightning-opcache-xdebug-imagick/41883)

<div class="topic-metadata">

**Author:** [@sebastian](https://community.localwp.com/u/sebastian)\
**Replies:** 12\
**Last updated:** [March 28, 2024, 9:26am UTC](https://community.localwp.com/t/m1-mac-loading-x86-libraries-local-lightning-opcache-xdebug-imagick/41883 "2024-03-28T09:26:01Z")

</div>

Bug Summary PHP extensions (opcache.so, xdebug.so, and imagick.so) are compiled for the x86\_64 not for ARM processors. Summarize the issue in one to two sentences. Steps to reproduce Use an M series Apple computer, sta…

---

## [WP-CLI in Site Shell emits PHP warnings](https://community.localwp.com/t/wp-cli-in-site-shell-emits-php-warnings/30125)

<div class="topic-metadata">

**Author:** [@weston](https://community.localwp.com/u/weston)\
**Replies:** 11\
**Last updated:** [October 4, 2023, 11:04pm UTC](https://community.localwp.com/t/wp-cli-in-site-shell-emits-php-warnings/30125 "2023-10-04T23:04:09Z")

</div>

Bug Summary When I select PHP 8.0.0 and open Site Shell, running any WP-CLI command results in the following being printed to STDERR: Cannot load Zend OPcache - it was already loaded And then the command runs as expect…

---

## ['wp-scripts' error when using site shell](https://community.localwp.com/t/wp-scripts-error-when-using-site-shell/39309)

<div class="topic-metadata">

**Author:** [@JakePowell](https://community.localwp.com/u/JakePowell)\
**Replies:** 1\
**Last updated:** [September 27, 2023, 2:30pm UTC](https://community.localwp.com/t/wp-scripts-error-when-using-site-shell/39309 "2023-09-27T14:30:16Z")

</div>

What issue or error are you experiencing? I’m following the guide to create a block (Scaffold your first block | Learn WordPress). I’ve done it previously with no issues but now I’m getting Error: Command failed with e…

---

## [PHP installation missing MySQL extension required by Wordpress](https://community.localwp.com/t/php-installation-missing-mysql-extension-required-by-wordpress/37779)

<div class="topic-metadata">

**Author:** [@dolldothouse](https://community.localwp.com/u/dolldothouse)\
**Replies:** 4\
**Last updated:** [June 29, 2023, 10:21pm UTC](https://community.localwp.com/t/php-installation-missing-mysql-extension-required-by-wordpress/37779 "2023-06-29T22:21:57Z")

</div>

Issue Summary trying to use wp cli in the localwp site shell but running into “Error: Your PHP installation appears to be missing the MySQL extension which is required by WordPress. Please check that the mysqli PHP ext…

---

## [Can't use WP-CLI // zsh: command not found: wp](https://community.localwp.com/t/cant-use-wp-cli-zsh-command-not-found-wp/37679)

<div class="topic-metadata">

**Author:** [@mrsippy](https://community.localwp.com/u/mrsippy)\
**Replies:** 3\
**Last updated:** [June 23, 2023, 5:14pm UTC](https://community.localwp.com/t/cant-use-wp-cli-zsh-command-not-found-wp/37679 "2023-06-23T17:14:52Z")

</div>

Issue Summary Cannot use WP-CLI in site shell, attempting to do so returns “zsh: command not found: wp” Troubleshooting Questions This happens for all of my Local sites, when attempting to invoke WP-CLI commands. Repli…

---

## [WP CLI - Windows - Error establishing a database connection](https://community.localwp.com/t/wp-cli-windows-error-establishing-a-database-connection/36064)

<div class="topic-metadata">

**Author:** [@JDev](https://community.localwp.com/u/JDev)\
**Replies:** 2\
**Last updated:** [March 22, 2023, 11:36pm UTC](https://community.localwp.com/t/wp-cli-windows-error-establishing-a-database-connection/36064 "2023-03-22T23:36:36Z")

</div>

Issue Summary I realise you can “Open site shell” on each install however I want to create a script including wp cli tasks to automate updates etc. Is there a way to allow for wp cli commands on regular Command Prompt? I…

---

## [WP CLI could not create temporary file for media import](https://community.localwp.com/t/wp-cli-could-not-create-temporary-file-for-media-import/36059)

<div class="topic-metadata">

**Author:** [@moodacow](https://community.localwp.com/u/moodacow)\
**Replies:** 1\
**Last updated:** [March 22, 2023, 5:13pm UTC](https://community.localwp.com/t/wp-cli-could-not-create-temporary-file-for-media-import/36059 "2023-03-22T17:13:54Z")

</div>

Hello, After having downloaded a lot of images in the uploads folder without using the export/import function from Wordpress or any plugin, I would like to load them in the website. For this, I wan’t to use WP CLI and …

---

## [Wp db reset doesn't work correctly with MySQL](https://community.localwp.com/t/wp-db-reset-doesnt-work-correctly-with-mysql/30848)

<div class="topic-metadata">

**Author:** [@slaFFik](https://community.localwp.com/u/slaFFik)\
**Replies:** 19\
**Last updated:** [January 5, 2023, 3:16pm UTC](https://community.localwp.com/t/wp-db-reset-doesnt-work-correctly-with-mysql/30848 "2023-01-05T15:16:17Z")

</div>

Bug Summary When trying to reset a site using WP CLI I get this error: $ wp db reset Are you sure you want to reset the 'local' database? \[y/n\] y Error: Failed to get current SQL modes. Reason: '"mysql --no-defaults --n…

---

## [WP-CLI WP\_CLI::runcommand() always returns Could not open input file: /Applications/Local](https://community.localwp.com/t/wp-cli-wp-cli-runcommand-always-returns-could-not-open-input-file-applications-local/34752)

<div class="topic-metadata">

**Author:** [@robruiz](https://community.localwp.com/u/robruiz)\
**Replies:** 0\
**Last updated:** [December 14, 2022, 6:35pm UTC](https://community.localwp.com/t/wp-cli-wp-cli-runcommand-always-returns-could-not-open-input-file-applications-local/34752 "2022-12-14T18:35:28Z")

</div>

Issue Summary I am writing some custom WP CLI commands. In those commands, I am attempting to use the WP\_CLI::runcommand() function, however, no matter what WP CLI command I attempt to get it to run, it always returns “C…

---

## [Local on Windows not using bundled WP-CLI](https://community.localwp.com/t/local-on-windows-not-using-bundled-wp-cli/33815)

<div class="topic-metadata">

**Author:** [@sternerstuff](https://community.localwp.com/u/sternerstuff)\
**Replies:** 0\
**Last updated:** [October 21, 2022, 7:33pm UTC](https://community.localwp.com/t/local-on-windows-not-using-bundled-wp-cli/33815 "2022-10-21T19:33:47Z")

</div>

Bug Summary If I “Open Site Shell” and run which wp, it shows the version of WP-CLI I’ve installed globally on my machine via Composer, assuming it’s been added to my PATH. If I remove it from my PATH, I actually get an …

---

## [Problem with WP CLI](https://community.localwp.com/t/problem-with-wp-cli/30462)

<div class="topic-metadata">

**Author:** [@epigeyre](https://community.localwp.com/u/epigeyre)\
**Replies:** 9\
**Last updated:** [September 20, 2022, 12:17pm UTC](https://community.localwp.com/t/problem-with-wp-cli/30462 "2022-09-20T12:17:56Z")

</div>

Issue Summary When trying to run the wp post create wp-cli command in my local Site Shell I get the following error: Fatal error: Cannot declare class WP\_CLI, because the name is already in use in phar:///Applications/…

---

## [Could not open input file: C:\\Program](https://community.localwp.com/t/could-not-open-input-file-c-program/32739)

<div class="topic-metadata">

**Author:** [@MikeD](https://community.localwp.com/u/MikeD)\
**Replies:** 6\
**Last updated:** [August 4, 2022, 9:27pm UTC](https://community.localwp.com/t/could-not-open-input-file-c-program/32739 "2022-08-04T21:27:17Z")

</div>

Issue Summary I’m trying to install a WP-CLI package and its companion plugin. The package installs just fine and the plugin appears to do so as well, but it throws up this line when it’s done installing: Could not ope…

---

## [Change File permissions with WP CLI?](https://community.localwp.com/t/change-file-permissions-with-wp-cli/32034)

<div class="topic-metadata">

**Author:** [@davidBen](https://community.localwp.com/u/davidBen)\
**Replies:** 1\
**Last updated:** [June 9, 2022, 10:54am UTC](https://community.localwp.com/t/change-file-permissions-with-wp-cli/32034 "2022-06-09T10:54:34Z")

</div>

Hello how can i change permission of /wp-content/ with WP CLI, i’m using windows 10. i searched and found only explanation if using unix/linux. Thank you

---

## [WP CLI Error establishing a database connection](https://community.localwp.com/t/wp-cli-error-establishing-a-database-connection/31677)

<div class="topic-metadata">

**Author:** [@mrengy](https://community.localwp.com/u/mrengy)\
**Replies:** 2\
**Last updated:** [May 20, 2022, 1:53am UTC](https://community.localwp.com/t/wp-cli-error-establishing-a-database-connection/31677 "2022-05-20T01:53:13Z")

</div>

Issue Summary With my site in Local running when I run a WP CLI command like “wp plugin list”, I get “Error establishing a database connection” in the command line. I am able to access the site fine in a browser in this …

---

## [Installing and using WP-CLI with Local WP](https://community.localwp.com/t/installing-and-using-wp-cli-with-local-wp/30908)

<div class="topic-metadata">

**Author:** [@sambaji](https://community.localwp.com/u/sambaji)\
**Replies:** 1\
**Last updated:** [March 18, 2022, 5:46pm UTC](https://community.localwp.com/t/installing-and-using-wp-cli-with-local-wp/30908 "2022-03-18T17:46:20Z")

</div>

I want to use this WP CLI plugin to export custom template and template-parts from the database to the theme folder when working in Local WP: https://bintzpress.com/wordpress-full-site-editing-and-custom-themes-2360ba88…

[Next page](https://community.localwp.com/tag/wp-cli/48.md?match_all_tags=true&page=1&tags%5B%5D=wp-cli)
