I recently cloned a laravel project and after running composer install, I am getting this error
In LogManager.php line 416:
Use of undefined constant JSON_INVALID_UTF8_SUBSTITUTE - assumed 'JSON_INVALID_UTF8_SUBSTITUTE'
I have checked the web for solutions but can't find any related. Any assistance, please?
Also, how can I find the LogManager.php? It doesn't seem to be available when I search with VSCode
You should upgrade your php version to 7.2+. If that is not possible, here is a fix that i used. Just add this to your index.php file:
if (!defined('JSON_INVALID_UTF8_SUBSTITUTE')) {
//PHP < 7.2 Define it as 0 so it does nothing
define('JSON_INVALID_UTF8_SUBSTITUTE', 0);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With