# WP-CLI Plugin List Error with PHP 8.1.29

**URL:** <https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670>\
**Category:** Support\
**Created:** [November 21, 2024, 2:45pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670 "2024-11-21T14:45:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mac72](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@Mac72](https://community.localwp.com/u/Mac72)\
**Post date:** [November 21, 2024, 2:45pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670/1 "2024-11-21T14:45:51Z")

</div>

### What issue or error are you experiencing?

Hello,

I’m experiencing an issue with WP-CLI on my Local setup. When running `wp plugin list`:

Parse error: syntax error, unexpected token “?” in phar:///Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP\_CLI/Runner.php(1335) : eval()'d code on line 2

* * *

### What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

My current setup:

- Local version: [insert version of Local you’re using]
- PHP version: 8.1.29
- WP-CLI version: 2.11.0

I’ve attempted the following troubleshooting steps without success:

- Tried reinstalling WP-CLI globally
- Tested different PHP versions (8.1.29 and Local’s PHP)
- Cleared WP-CLI cache and re-downloaded `wp-cli.phar`

Could you assist in resolving this issue? It seems related to PHP and WP-CLI compatibility within Local.

* * *

### System Details

- **Version 9.1.0+6719**

- **MACOS - 13.7.1 (22H221)**

* * *

### Local Logs

Attach your Local Logs here ([Help Doc - Retrieving Local’s Log](https://localwp.com/help-docs/troubleshooting/retrieving-locals-log-file/))

* * *

_ **Security Reminder** _  
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [November 21, 2024, 3:17pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670/2 "2024-11-21T15:17:12Z")

</div>

Hi @Mac72

It might be a compatibility issue with the site and the version of PHP. Was this a site you pulled or imported from elsewhere? Does the PHP version in Local match what it was using?

---

<div class="post-metadata">

**Author:** ![Mac72](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@Mac72](https://community.localwp.com/u/Mac72)\
**Post date:** [November 21, 2024, 3:36pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670/3 "2024-11-21T15:36:57Z")

</div>

Yes it does and this is a brand new site that I’ve built from scratch. Also here is some more info:

WP-CLI: WP-CLI 2.11.0  
Composer: 2.6.2 2023-09-03  
PHP: 8.3.11  
MySQL: mysql Ver 8.0.16 for macos10.14 on x86\_64 (MySQL Community Server - GPL)

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [November 21, 2024, 3:39pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670/4 "2024-11-21T15:39:49Z")

</div>

Instead of `wp plugin list` can you run `wp plugin deactivate --all`? It might be if you have custom code in a plugin or theme that could be contributing the issue.

You could still try lowering the PHP version of the site as well. Maybe something isn’t compatible with PHP 8.3.11 so you could try 8.2, 8.1, etc.

---

<div class="post-metadata">

**Author:** ![Mac72](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@Mac72](https://community.localwp.com/u/Mac72)\
**Post date:** [November 21, 2024, 3:53pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670/5 "2024-11-21T15:53:37Z")

</div>

I’ve tried lowering the PHP version and I’ve also triemd wp plugin deactivate -all to no avail. I think it’s related to WP-CLI - Local which I tried running globally.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [November 21, 2024, 4:13pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670/6 "2024-11-21T16:13:10Z")

</div>

If you create a new, blank site and add a plugin does the same behavior persist over there? If it does then you may need to try a full uninstall and reinstall of Local making sure to export and save your site and any work you have in the app first.

We have OS specific uninstall instructions here as you may need to manually remove certain configuration items. [Uninstall Local - Local](https://localwp.com/help-docs/troubleshooting/uninstalling-local/)

---

<div class="post-metadata">

**Author:** ![Mac72](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@Mac72](https://community.localwp.com/u/Mac72)\
**Post date:** [November 21, 2024, 4:24pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670/7 "2024-11-21T16:24:53Z")

</div>

Thanks Nick. I have a plugin which can handle the site export I’ll give it a go and create a fresh site.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [February 19, 2025, 4:24pm UTC](https://community.localwp.com/t/wp-cli-plugin-list-error-with-php-8-1-29/45670/8 "2025-02-19T16:24:54Z")

</div>

Closed on February 19, 2025, 4:24pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
