According to Alain Schlesser in wordpress slack:
The folder that the packages are installed into is set to use your server user’s home folder. When you try to execute this command from PHP, however, it is being executed by the webserver’s user, which probably has a different home folder, and the package is not installed in there.
You can either load the package manually as part of the system (requiring it in the site’s Composer stack, for example), or set the package folder to a location that is shared by both your user and your webserver (and reinstall it afterwards).
You can set the packages folder with the WP_CLI_PACKAGES_DIR
environment variable: https://make.wordpress.org/cli/handbook/config/#environment-variables
Related Posts:
- Running WP Cron on multisite the right way
- WP-CLI – Selecting PHP version
- WP CLI info showing correct PHP binary but wrong version of PHP
- Utilize WP-CLI from inside WordPress, not SSH
- Setting Up PHPUnit tests for WP development on Windows
- Configuring WP-CLI on Windows 10
- PHPCS: Strings should have translatable content
- wp search-replace on database returns PHP fatal error: Array and string offset access syntax with curly braces is no longer supported
- PHP Parse error on WP-CLI, not on web server
- WP-CLi PHP Warning: mysqli_query(): (HY000/1356): View During Search Replace
- call to undefined function mysql_connect
- How come there is no error if I upgrade WordPress core after locking .htaccess permissions to 644?
- Full search and replace isn’t enough to make all pictures to be loaded with https
- PHP – how to create a newline character?
- how to get permalink structure with php
- Add a wp editor to custom plugin and save data
- How to display content from post_parent
- How can I loop into two different DIVS without repeating the DIVs
- File upload, uploads only file name
- Get_the_author doesn’t return author name
- How can I add tinymce editor in WordPress with jQuery?
- Double or Single Quotes in WordPress Content Conflicting With HTML
- How can i display post loop in table format?
- HTML tags in bloginfo description
- PHP variable = get_the_post_thumbnail_url outputting without slashes
- Automatically adding new post categories to menu
- WordPress every page is 404 not found including admin resources
- get author_name from queried post
- post thumbnail, conditions, else wont work
- PHP in Edit Post link
- Split shortcodes to array of shortcodes
- How can I reduce time to first byte?
- error_log PHP error log found. This file must not be in the production version of the theme. (wordpress theme check plugin)
- how can i include post meta in search result
- Shortcode in Shortcode/HTML Graphics and Pictures
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- Create a new account on site B with data from the purchase of site A
- Does the namespace always have to be prefixed to the function or class when referencing callbacks in WordPress, even when they are in the same file?
- Why is the current page loaded in the pop-up window and not the specified one?
- How to allow users to save list of posts in wordpress?
- WP_Query next image
- How to get content on a blank basket/cart page in a custom theme with woocommerce
- Submit remote form to wordpress REST API and save data to custom post type
- Where do I implement this display of User Meta Data, and how to put it in a table?
- Modal opens all post IDs
- Custom meta box save values issues – Deprecated: Function ereg() and more
- Ninja Forms – pull in some post related information
- Echo the featured image of page assigned to blog in index.php
- best way to communicate between php and jquery/javascript
- Correct way to perform a GET to another PHP file hosted on wordpress
- Understanding responsive imagery
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- Cannot install plugins or themes on new WordPress installation at Cloudways
- Custom WP LIST Table filter
- WordPress online courses system
- How to align buttons properly [closed]
- index.php file keeps redirecting to a non-existent index.html file?
- How to pass parameter to another url?
- HTTP 500 Error after Creating Shortcode
- Show button in header when product custom field is not empty
- Why a class property becomes empty?
- how to goto specific page number including title with permalink
- get_the_term_list give me a whitespace
- Hide category by tag
- understanding wp_next_scheduled
- WordPress 6.1.1 UTF8 Slug Limit Increase
- WordPress directories not writable after PHP version upgrade
- How do I unset category from a product in wordpress by code
- How to change wp-admin and wp-login urls
- How to get meta box labels?
- get_query_vars always retruns empty value
- How to group by column a and sum column b and c in a php array
- Convert custom field date format to “WordPress default”
- Woocommerce Convert existing order to the cart
- Execute function when I click button
- links Slick jS library using wp_enqueue_scripts not pulling
- How to run site locally after downloading database
- How to change shipping method title based on cart amount?
- Redirect posts to post editor page based on query string
- How do I stylize selected comments?
- Displaying generated HTML within a WordPress site
- WordPress PHP8 Critical Error in class-wp-widget.php
- How to get the last date updated of postmeta?
- How to add SKU and remove product title from WooCommerce url?
- php 8 compability admin interface
- How can I make below code to show grouping by country ranks in same div, example if in second loop rank 2nd must be show in same 2nd class div
- add_rewrite_rule image from /images/site2/favicon.ico to /favico.ico
- Load style and script for custom post type metabox
- Permissions error when I use my plugin to delete comments in the front-end
- Product Search in search.php
- Background Tasks in a WP Cronjob?
- How to execute a shortcode within a custom field?
- using custom pages for myaccount in woocommerce
- Putting form result in my database
- SQL – How to echo out inside of where statement
- How to create different templates for woocommerce single-product.php?
- How can I update a value of a field depending on outside source?
- Restricting access to a file for everyone except logged in users
- WordPress Block Editor Gutenberg running code inside ! is_admin()
- Tags being Inserted in html from plugin PHP not passing through the_content