skip to Main Content

Error screenshoot

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


  1. 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:

    sudo zypper install php7-json
    

    to install php7-json.

    Installation requirements for Laravel 5.7 are documented here under openSUSE

    Login or Signup to reply.
  2. I had the same problem and I solved with the command:

    sudo phpenmod json
    

    Then I restarted the web server and PHP.

    sudo system nginx restart
    
    sudo system php7.4-fpm restart
    

    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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search