Support » Localhost Installs » Warning: undefined array key … in wp-cli.phar on line 213

  • Resolved enrique71

    (@enrique71)


    I installed wp-cli according to instructions on Win 10 but now it’s giving me this weird error that appears nowhere on the internet. When I use command wp cli update:

    Warning: Undefined array key “a:1:{s:3:”ssl”;b:1;}” in phar://C:/wp-cli/wp-cli.phar/vendor/rmccue/requests/library/Requests.php on line 213
    Error: Failed to get url ‘https://api.github.com/repos/wp-cli/wp-cli/releases?per_page=100’: No working transports found.

    I figured it was an environment issue so I checked and php wasn’t installed. So I installed latest version. Turns out that on Windows, php requires Visual Studio 19 so I installed that. Then I re-downloaded the .phar and it still gives that error.

    The PATH has everything it should afaik. I am using MAMP for Windows. Maybe I don’t need PHP installed to my Windows since it’s running virtualized in MAMP? Is there a conflict between the MAMP php.ini and the Windows php.ini? Is there a conflict between MAMP’s php 7.4.1 and Windows’ php 8.0.3? Does the “ssl” in the array mean I need to install ssl keys?

    Thanks for any suggestions.

    • This topic was modified 2 weeks, 6 days ago by enrique71.
    • This topic was modified 2 weeks, 6 days ago by enrique71.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter enrique71

    (@enrique71)

    Update: I needed to create a (development) php.ini and uncomment extension=openssl as well as the extension_dir = "ext" variable.

    Now php is giving two “fsockopen.php” errors.

    Thread Starter enrique71

    (@enrique71)

    Well, I managed to get php working on my machine by following instructions here:
    http://www.jamespgilbert.com/2019/09/up-and-running-fast-with-php-apache-on-windows-10/

    However now that installation conflicts with MAMP, so that MAMP has to run on port 81. The locally installed WP no longer runs.

    Uninstalled the separate install of php by removing the Path declaration. Then went back into Windows Features and unchecked all Internet Information Services that the above site recommended for php. Restarted, and now MAMP and the site work again.

    Now, back to the start: type wp at the administrator command line… the result:

    ‘php’ is not recognized as an internal or external command,
    operable program or batch file.

    Completely flummoxed.

    • This reply was modified 2 weeks, 6 days ago by enrique71.
    Thread Starter enrique71

    (@enrique71)

    The problem was that the php version running under MAMP was not registered in the Windows PATH. Not sure how that happened. I added the path directly to the currently running version and restarted Windows, and everything runs fine.

    • This reply was modified 2 weeks, 6 days ago by enrique71.
    • This reply was modified 2 weeks, 6 days ago by enrique71.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.