Hi, I deploied my Laravel app on a shared server; I got this error when i try to open my website: Use of undefined constant JSON_UNESCAPED_SLASHES - assumed 'JSON_UNESCAPED_SLASHES' (this will throw an Error in a future version of PHP)
.
- I think it’s a PHP issue but there’s 7.3 php version on my server (I used Laravel 7).
- I tried to open my homepage without any blade tag but it return the same result exception throwed.
So I turned to you. I need help.
2
Answers
I solved it on my openSUSE box installing the php7-json package, which in turn asked me to uninstall php8, because it conflicted with it.
In case you’re (like myself) using openSUSE you should run:
to install php7-json.
Installation requirements for Laravel 5.7 are documented here under openSUSE
I had the same problem and I solved with the command:
Then I restarted the web server and PHP.
Note: I used Nginx. If you use other web server such as Apache use the command: sudo service apache2 restart. And if you use a php version other than 7.4 replace it with your version.