1

New to magento

I wanted to upgrade my Magento to 2.4.4 . Using php 7.4 with Ubuntu 20.04 and nginx

composer -vvv update

I get this:

Dependency resolution completed in 0.003 seconds
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
> post-autoload-dump: Laminas\DependencyPlugin\DependencyRewriterPluginDelegator->onPostAutoloadDump
119 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> post-update-cmd: MagentoHackathon\Composer\Magento\Plugin->onNewCodeEvent
start magento deploy via deployManager
jump over deployLibraries as no Magento libraryPath is set
> post-update-cmd: Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin->onDependenciesChangedEvent
Running PHPCodeSniffer Composer Installer
Executing command (/var/www/magento2/vendor/bin): phpcs --config-show
Executing command (/var/www/magento2/vendor/squizlabs/php_codesniffer): '/usr/bin/php7.4' -d allow_url_fopen='1' -d disable_functions='' -d memory_limit='-1' ./bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility
Failed to set PHP CodeSniffer installed_paths Config

so I go to the directory /var/www/magento2/vendor/squizlabs/php_codesniffer and run the command '/usr/bin/php7.4' -d allow_url_fopen='1' -d disable_functions='' -d memory_limit='-1' ./bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility

I get:

PHP Warning:  require(/var/www/magento2/vendor/composer/../../app/etc/NonComposerComponentRegistration.php): failed to open stream: No such file or directory in /var/www/magento2/vendor/composer/autoload_real.php on line 59
PHP Fatal error:  require(): Failed opening required '/var/www/magento2/vendor/composer/../../app/etc/NonComposerComponentRegistration.php' (include_path='/var/www/magento2/vendor/magento/zendframework1/library:.:/usr/share/php') in /var/www/magento2/vendor/composer/autoload_real.php on line 59

clearly this is a path issue with my composer and I do not have any NonComposerComponentRegistration.php

How do I correct this path issue? should I just uninstall composer and reinstall it? hopefully this won't affect my magento install.

1
  • 1
    further to my investigation /app/bootstrap.php is missing with bunch of other files!
    – Henri
    Commented May 9, 2022 at 10:59

2 Answers 2

0

I deleted the vendor folder completely. Reset the permissions of all files. the sudo composer install and it solved my issue.

0

simple case:

From the html directory run vendor/bin/phpcs --config-show
If installed_paths is not listed, or is incorrect run the following:

vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility

case with code or module issues:

If vendor/bin/phpcs --config-show shows no output there could be an error in a module or a deployment problem.
Run phpdbg vendor/bin/phpcs --config-show
At the prompt press r, capture the error, quit, and then correct the error.

For example, in the output below, I had a cached module that was incompatible with a pending update. Removing the cached module cleared the error.

$ phpdbg vendor/bin/phpcs --config-show

[Welcome to phpdbg, the interactive PHP debugger, v8.1.27]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://bugs.php.net/report.php>]
[Successful compilation of /var/www/magento/html/vendor/bin/phpcs]

prompt> r

[Uncaught LogicException in /var/www/magento/html/vendor/magento/framework/Component/ComponentRegistrar.php on line 48: Module '<some module>' from '/var/www/magento/html/app/code/<cached module>]
>00050:                 . 'has been already defined in \'' . self::$paths[$type][$componentName] . '\'.'
 00051:             );
 00052:         }

prompt> quit

$ rm -rf app/code/<cached module>
$ phpdbg vendor/bin/phpcs --config-show
[Welcome to phpdbg, the interactive PHP debugger, v8.1.27]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://bugs.php.net/report.php>]
[Successful compilation of /var/www/magento/html/vendor/bin/phpcs]
prompt> r
Using config file: 

[Script ended normally]
prompt> quit

$ vendor/bin/phpcs --config-show
Using config file: 

$ vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility
Using config file: /var/www/magento/html/vendor/squizlabs/php_codesniffer/CodeSniffer.conf

Config value "installed_paths" added successfully

$ vendor/bin/phpcs --config-show
Using config file: /var/www/magento/html/vendor/squizlabs/php_codesniffer/CodeSniffer.conf

installed_paths: ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility

Now composer update proceeds without this error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.