• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Stack trace error. Website not loading

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Following is the stack trace. My website is constantly giving a 500 error. Can anyone help please?



Stack trace:
#0 /home/excalib1/tnstore/vendor/composer/ClassLoader.php(480): include()
#1 /home/excalib1/tnstore/vendor/composer/ClassLoader.php(346): Composer\Autoload\includeFile('/home/excalib1/...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Supp...')
#3 /home/excalib1/tnstore/vendor/laravel/framework/src/Illuminate/Support/Collection.php(11): spl_autoload_call('Illuminate\\Supp...')
#4 /home/excalib1/tnstore/vendor/composer/ClassLoader.php(480): include('/home/excalib1/...')
#5 /home/excalib1/tnstore/vendor/composer/ClassLoader.php(346): Composer\Autoload\includeFile('/home/excalib1/...')
#6 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Supp...')
#7 /home/excalib1/tnstore/vendor/laravel/framework/src/Illuminate/Support/helpers.php(110): spl_autoload_call('Illuminate\\Supp...')
#8 /home/excalib1/tn in /home/excalib1/tnstore/vendor/laravel/framework/src/Illuminate/Support/Enumerable.php on line 11
[27-Oct-2021 08:38:48 UTC] PHP Fatal error:  Uncaught Error: Interface 'JsonSerializable' not found in /home/excalib1/tnstore/vendor/laravel/framework/src/Illuminate/Support/Enumerable.php:11
Stack trace:
#0 /home/excalib1/tnstore/vendor/composer/ClassLoader.php(480): include()
#1 /home/excalib1/tnstore/vendor/composer/ClassLoader.php(346): Composer\Autoload\includeFile('/home/excalib1/...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClas
 
Saloon Keeper
Posts: 7161
165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

What does

Uncaught Error: Interface 'JsonSerializable' not found


tell you?
 
Ahmed Moud
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My web developer made this and is not available right now.

I am trying to sort the issue myself.

Would really appreciate if you could help me out.

I am a novice

Thank you.
 
Sheriff
Posts: 22504
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JsonSerializable has been available since PHP 5.4, and I doubt that your PHP version is older, so there's probably an incorrect import.

I think this error can occur if you try to use a class from the global namespace like JsonSerializable but also others like InvalidArgumentException without either adding a use statement at the top, or to use an absolute path: \JsonSerializable.

With use instead:
 
Ahmed Moud
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was able to resolve the json error.

Current stack trace is:

Stack trace:
#0 /home/excalib1/tnstore.pk/vendor/symfony/var-dumper/Dumper/HtmlDumper.php(950): Symfony\Component\VarDumper\Dumper\HtmlDumper->getDumpHeader()
#1 /home/excalib1/tnstore.pk/vendor/symfony/var-dumper/Dumper/CliDumper.php(571): Symfony\Component\VarDumper\Dumper\HtmlDumper->dumpLine(0, true)
#2 /home/excalib1/tnstore.pk/vendor/symfony/var-dumper/Dumper/CliDumper.php(259): Symfony\Component\VarDumper\Dumper\CliDumper->endValue(Object(Symfony\Component\VarDumper\Cloner\Cursor))
#3 /home/excalib1/tnstore.pk/vendor/symfony/var-dumper/Dumper/HtmlDumper.php(799): Symfony\Component\VarDumper\Dumper\CliDumper->dumpString(Object(Symfony\Component\VarDumper\Cloner\Cursor), 'Use of undefine...', false, 0)
#4 /home/excalib1/tnstore.pk/vendor/symfony/var-dumper/Cloner/Data.php(416): Symfony\Component\VarDumper\Dumper\HtmlDumper->dumpString in /home/excalib1/tnstore.pk/vendor/symfony/var-dumper/Dumper/HtmlDumper.php on line 157



Line 157 is:

$line = str_replace('{$options}', json_encode($this->displayOptions, \JSON_FORCE_OBJECT), <<<'EOHTML'


Please help.
 
Ahmed Moud
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. Can someone please assist?
 
Rob Spoor
Sheriff
Posts: 22504
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSON_FORCE_OBJECT is a constant, not a class (see https://www.php.net/manual/en/json.constants.php). You can't use \ to prefix constants, only to prefix classes in the global namespace.
 
reply
    Bookmark Topic Watch Topic
  • New Topic