Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught ArgumentCountError: array_merge() #70

Closed
aryanrajseo opened this issue Jan 11, 2021 · 6 comments
Closed

Fatal error: Uncaught ArgumentCountError: array_merge() #70

aryanrajseo opened this issue Jan 11, 2021 · 6 comments

Comments

@aryanrajseo
Copy link

aryanrajseo commented Jan 11, 2021

Hi, i updated my Mac to Big Sur and My valet Installation got broken. i have tried to reinstall everything but seems like am missing something.

I installed the Laravel Valet as per docs and it is working. However I was not able to run mariadb or php, it shows status error in brew services list, currently mysql is linked.

aryanraj$ brew services list
Name    Status  User           Plist
dnsmasq started root           /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mariadb error   aryanraj /Users/aryanraj/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
mysql   error   root           /Library/LaunchDaemons/homebrew.mxcl.mysql.plist
nginx   started root           /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php     started root           /Library/LaunchDaemons/homebrew.mxcl.php.plist

However, i thought it is temporary as per Homebrew/homebrew-services#92 so moved to install wp-cli-valet-command but this is throwing error.

I am not sure why it is not working. I am able to create laravel site using laravel new mylarsite. Here is the error.

aryanraj$ wp cli info
OS:     Darwin 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64
Shell:  /bin/bash
PHP binary:     /usr/local/Cellar/php/8.0.1/bin/php
PHP version:    8.0.1
php.ini used:   /usr/local/etc/php/8.0/php.ini
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /Users/aryanraj
WP-CLI packages dir:    /Users/aryanraj/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.4.0

aryanraj$ brew install wp-cli
Updating Homebrew...
Warning: wp-cli 2.4.0 is already installed and up-to-date
To reinstall 2.4.0, run `brew reinstall wp-cli`
aryanraj$ wp package install [email protected]:aaemnnosttv/wp-cli-valet-command.git
Installing package aaemnnosttv/wp-cli-valet-command (dev-master)
Updating /Users/aryanraj/.wp-cli/packages/composer.json to require the package...
Registering [email protected]:aaemnnosttv/wp-cli-valet-command.git as a VCS repository...

Deprecated: Required parameter $path follows optional parameter $schema in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php on line 62

Deprecated: Required parameter $path follows optional parameter $schema in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php on line 108

Deprecated: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php on line 130

Deprecated: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php on line 130

Deprecated: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php on line 130

Deprecated: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php on line 130

Deprecated: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php on line 130

Deprecated: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php on line 130

Deprecated: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php on line 130
Using Composer to install the package...
---
Loading composer repositories with package information
Updating dependencies

Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php:84
Stack trace:
#0 [internal function]: array_merge(symfony/filesystem: Array)
#1 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array('array_merge', Array)
#2 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Installer.php(1034): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages(Object(Composer\DependencyResolver\Pool), Array, Array)
#3 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Installer.php(469): Composer\Installer->processDevPackages(Object(Composer\Repository\InstalledFilesystemRepository), Object(Composer\DependencyResolver\Pool), Object(Composer\DependencyResolver\DefaultPolicy), Array, Object(Composer\Repository\CompositeRepository), NULL, 'force-links')
#4 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Installer.php(229): Composer\Installer->doInstall(Object(Composer\Repository\InstalledFilesystemRepository), Object(Composer\Repository\CompositeRepository), Object(Composer\Repository\PlatformRepository), Array)
#5 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/package-command/src/Package_Command.php(385): Composer\Installer->run()
#6 [internal function]: Package_Command->install(Array, Array)
#7 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(98): call_user_func(Array, Array, Array)
#8 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#9 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(451): call_user_func(Object(Closure), Array, Array)
#10 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(371): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#11 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(394): WP_CLI\Runner->run_command(Array, Array)
#12 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(87): WP_CLI\Runner->run_command_and_exit()
#13 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1102): WP_CLI\Runner->do_early_invoke('before_wp_load')
#14 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
#15 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(74): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#16 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
#17 phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/php/boot-phar.php(11): include('phar:///usr/loc...')
#18 /usr/local/Cellar/wp-cli/2.4.0/bin/wp(4): include('phar:///usr/loc...')
#19 {main}
  thrown in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php on line 84
Reverted composer.json.
@aaemnnosttv
Copy link
Owner

Hi there! This looks like a compatibility issue with PHP 8 due to an older version of Composer included with wp-cli.

To install the package without wp-cli, try this:

cd /Users/aryanraj/.wp-cli/packages/
composer require aaemnnosttv/wp-cli-valet-command

That should do it, although I'm not 100% sure if the package will work with PHP 8 just yet. Let me know how it goes 😄

@aryanrajseo
Copy link
Author

Hi, i restarted the computer and services are running, but installation not worked so i tried the above command and this showing error. I can change the php version to 7.1 as mentioned but Laravel websites seems require 7.3+, this is what i was getting when i was trying to use 7.2

Your Composer dependencies require a PHP version ">= 7.3.0". You are running 7.2.34

`composer require aaemnnosttv/wp-cli-valet-command` show this error.

Using version ^1.2 for aaemnnosttv/wp-cli-valet-command
./composer.json has been updated
Running composer update aaemnnosttv/wp-cli-valet-command
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - illuminate/container 5.7.x-dev is an alias of illuminate/container dev-master and thus requires it to be installed too.
    - aaemnnosttv/wp-cli-valet-command v1.2.1 requires illuminate/container >=5.1 <5.7 -> found illuminate/container[v5.1.1, ..., 5.6.x-dev] but the package is fixed to 5.7.x-dev (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - illuminate/container dev-master requires php ^7.1.3 -> your php version (8.0.1) does not satisfy that requirement.
    - aaemnnosttv/wp-cli-valet-command v1.2.0 requires illuminate/container ^5.1 -> satisfiable by illuminate/container[5.7.x-dev (alias of dev-master)].
    - Root composer.json requires aaemnnosttv/wp-cli-valet-command ^1.2 -> satisfiable by aaemnnosttv/wp-cli-valet-command[v1.2.0, v1.2.1].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

@aaemnnosttv
Copy link
Owner

If you downgraded your version of PHP, you should run composer update first to downgrade any packages as needed first and then try the command to require it again. The command will work on any version of PHP 7 so no problem there.

@aryanrajseo
Copy link
Author

Hi, Thanks. That fixed the issue but got the error for memory limit and increased it 2048 using #14 (comment), default was 512, 1024 not worked.

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32944552 bytes) in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/Cache.php on line 84

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/wp-cli/2.4.0/bin/wp/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Now it is installed but when i try to create new wp site using it shows Error.

wp valet new mywpsite

Don't go anywhere, this should only take a second...
Error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Seems problem with MySQL too laravel/valet#600, tried to unlink mysql and link mariadb but showing same error.

Any help will be really appreciated.

@seothemes
Copy link

seothemes commented Mar 15, 2021

Try running the following:

mysql.server stop

Then

mysql.server start

@aryanrajseo
Copy link
Author

Thank you @seothemes, I moved to Local and i am not sure if i have the same settings for Valet. If i remember, i may have tried this. but will try again. I am closing this ticket for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants