-
Notifications
You must be signed in to change notification settings - Fork 291
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
file_exists(): Unable to find the wrapper "phar" #410
Comments
Well first off, you should probably replace the path in your other stack frames too. Anyway, phar is enabled (or disabled) at compile time in PHP, it's not something you can just "Turn on" and since the phar file wrapper is missing it looks like your PHP was compiled without it. You can run Alternatively, you can add kint to your composer, or make a separate composer in a subfolder with only kint in it and require that autoloader beside your existing one |
Thanks @jnvsor. I did check phpinfo() before and Phar is enabled. See extract below, Phar |
Did you check "Registered PHP streams"? PHP is loading the phar fine, but the But this makes no sense, if the |
Yes @jnvsor I checked that:- I don't think the Phar file is corrupt. I downloaded it from here yesterday. And as i say above the same thing happens with Kint 4. I think the problem is an interaction with Magento (since the Magento 2.4 upgrade). I added the statement and got this output:- Then a bit further down the script I initialise the Magento environment
and the kint::dump($state) produces the error. |
When you put it that way it makes perfect sense if magento is blowing away the phar autoloader. What happens if you include the phar after magento bootstraps? |
Good idea - i will trry..... Nope - same error. |
So if you first include the phar and dump something right after that after your Does |
Exactly. phpinfo() reports phar is enabled after the script runs. Can i run kint outside of a Phar somehow? |
Should have checked the stream handler: magento/magento2#21973 So they deliberately disable the phar stream handler for security reasons. Apparently you can use |
Ok great - well spotted! Thanks for your help. Will try that. Surprised it's not come up here before because that dates back to Magento 2.3.1 in 2019 Revised working code
|
Hi All,
Getting this error message in a Magento script using Kint5.0.1. I am sure Phar is configured in PHP (8.1) running on Apache2. Tried Kint4 but the same thing
Warning: file_exists(): Unable to find the wrapper "phar" - did you forget to enable it when you configured PHP? ..../kint5/kint.phar/init_phar.php on line 41
Fatal error: Uncaught Error: Class "Kint\CallFinder" not found in phar:///...../kint5/kint.phar/src/Kint.php:661 Stack trace: #0 phar:///....../kint5/kint.phar/src/Kint.php(449): Kint\Kint::getSingleCall() #1 phar:///...../kint5/kint.phar/src/Kint.php(552): Kint\Kint::getCallInfo() #2 ...../testShowProducts.php(32): Kint\Kint::dump() #3 {main} thrown in phar:///......../kint5/kint.phar/src/Kint.php on line 661
Any suggestions please. I have hunted the internet to no avail so far for a solution (..... replaces the full path name for privacy) -
Thanks very much.
The text was updated successfully, but these errors were encountered: