Showing results for 
Search instead for 
Did you mean: 

magento 2.4.5 installation error

magento 2.4.5 installation error



Hi I am getting an error during installation.
magento version: 2.4.5-p1
composer: 2.5.1
ubuntu 22
nginx 1.18.0
php 8.1
all php extensions are installed
command run:
bin/magento setup:install \
--base-url= \
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password="U274eeGzNCqKJ2LpvtS@329" \
--admin-firstname=bob \
--admin-lastname=smith \ \
--admin-user=bob \
--admin-password=example@123 \
--language=en_US \
--currency=GBP \
--timezone=Europe/London \

here is the error:
array_merge(): Argument #2 must be of type array, string given#0 /var/www/html/setup/src/Magento/Setup/Model/ConfigModel.php(157): array_merge()
#1 /var/www/html/setup/src/Magento/Setup/Console/Command/InstallCommand.php(273): Magento\Setup\Model\ConfigModel->validate()
#2 /var/www/html/vendor/symfony/console/Command/Command.php(221): Magento\Setup\Console\Command\InstallCommand->initialize()
#3 /var/www/html/vendor/symfony/console/Application.php(1021): Symfony\Component\Console\Command\Command->run()
#4 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#5 /var/www/html/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun()
#6 /var/www/html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun()
#7 /var/www/html/bin/magento(23): Symfony\Component\Console\Application->run()
#8 {main}

please help


Re: magento 2.4.5 installation error

This error message is indicating that the second argument passed to the function "array_merge() "  is not an array, but instead it is a string. This function is used to merge multiple arrays into one.

The error is occurring in the "validate ()" method of the 'configModel' class located at 

'/var/www/html/setup/src/magento/setup/model/configmodel.php ' on line 157. To resolve the issue you need to find out where this string is coming from and convert it into an array before passing it to 'array_merge()'


1.check the parameters passed to the 'array_merge' function.

2. look for any code that might be modifying the input data before it is passed to the 'array_merge'

3. check if the correct data types are being passed into the function.

Re: magento 2.4.5 installation error

The error message indicates that the array_merge() function is expecting an array as its second argument, but is receiving a string instead. This could be caused by a configuration or syntax error in one of the configuration files.

Here are some steps you can try to resolve the issue:

  1. Check your PHP version: Magento 2.4.5-p1 is only compatible with PHP versions 7.4 and 8.0, so ensure that your PHP version is compatible.

  2. Check your Magento files: Make sure all Magento files have been downloaded properly and are not corrupted. Try downloading a fresh copy of Magento and reinstalling it.

  3. Check the configuration files: Check that the configuration files in the app/etc/ directory are properly configured. Specifically, check the env.php and config.php files for any syntax errors or incorrect configuration settings.

  4. Check the database: Ensure that the database has been set up properly and that the credentials in the installation command are correct.

  5. Clear cache and var directories: Clear the cache and var directories to ensure that old configuration files are not being used.

If none of these steps resolve the issue, you may want to try running the installation with the --debug flag to get more information about the error. You can also try reaching out to the Magento support team for further assistance.