1

I was able to run Magerun and suddenly is stopped working, and this error message showed up.

Warning: file_exists(): Unable to find the wrapper "phar" - did you forget to enable it when you configured PHP? in phar:///app/var/n98-magerun2.phar/vendor/composer/ClassLoader.php on line 384

Warning: file_exists(): Unable to find the wrapper "phar"

I'm pretty sure it's not related to phar package because I have it installed neither to Magerun because the same version worked before.

What else could it be related to?

3 Answers 3

1

The issue was a micro version, depending on your Magento version or PHP version you will have a minimum version.

Magento 2.0 (Magerun2 v2.3.3)

curl -O https://files.magerun.net/n98-magerun2-2.3.3.phar && mv n98-magerun2-2.3.3.phar n98-magerun2.phar && chmod +x ./n98-magerun2.phar && alias n98="./n98-magerun2.phar"

Magento 2.1 and Magento 2.2 (Magerun2 v3.2.0)

curl -O https://files.magerun.net/n98-magerun2-3.2.0.phar && mv n98-magerun2-3.2.0.phar n98-magerun2.phar && chmod +x ./n98-magerun2.phar && alias n98="./n98-magerun2.phar"

PHP 7.2 (Magerun2 v4.7.0)

curl -O https://files.magerun.net/n98-magerun2-4.7.0.phar && mv n98-magerun2-4.7.0.phar n98-magerun2.phar && chmod +x ./n98-magerun2.phar && alias n98="./n98-magerun2.phar"

Last version

curl -O https://files.magerun.net/n98-magerun2.phar && chmod +x ./n98-magerun2.phar && alias n98="./n98-magerun2.phar"
0

I had to add extension=php_openssl.dll to my php.ini file located in xampp/php/php.ini.

Somehow it was not there, after adding it and restarting Apache everything was working fine.

Another cause may be that your version of Magerun is old, you should upgrade it to the latest version.

0

Simply do this: php n98-magerun2.phar self-update

It will update to the latest version and fix this little bug.

Display the version as follows:

[root@localhost htdocs]# php81 n98-magerun2.phar -V

n98-magerun2 5.2.0 (commit: e11be34) by netz98 GmbH

(mine is 5.2.0, the latest. I'm using php81 in this example, use whatever php version you have)

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.